This topic provides reference information about:
Data types required for grouping on intervals of date or time values
How a page that groups records by month looks in Page view or in Microsoft Internet Explorer
How a page that groups records by month looks in Design view
Settings for properties in the Sorting And Grouping box
When you group records on date or time intervals, the control you group on must be bound to a field with one of the following data types: a Date/Time data type in a Microsoft Access database (.mdb), or a datetime or smalldatetime data type in a Microsoft Access project (.adp).
Return to top
To group records on an interval of date or time values, you need two controls. The control you group on is bound to the field that stores the date or time values and is hidden. The other control is bound to an expression that returns the interval of the date or time and is visible. In the following example, the records come from a query named Summary. The page uses an invisible control bound to the ShippedDate field to group records by month in the higher group level. In the same group level, another control, which is visible, is bound to an expression that returns the month equivalent of the ShippedDate field.
Return to top
In Design view of the example page, you can see the hidden control that is used to group the records in the first group level.
Return to top
The following table lists the properties that are set for the page in the Sorting And Grouping box. When you don't specify ASC or DESC after the field name in the DefaultSort property, Microsoft Access sorts the records in ascending order.
Property | Group Record Source Summary-ShippedDate |
Group Record Source Summary |
---|---|---|
CaptionSection | No | Yes |
GroupHeader | Yes | Yes |
GroupFooter | No | No |
RecordNavigation Section | Yes | Yes |
ExpandedByDefault | No | No |
DataPageSize | 3 | 3 |
GroupOn | Year | Qtr |
GroupInterval | 1.0 | 1.0 |
DefaultSort | GroupOfShippedDate | ShippedDate |
Note When you group on a control, Access creates an alias for the control by adding the prefix "GroupOf" to the control's name in the ControlSource property; for example, GroupOfShippedDate: ShippedDate. When you reference this control in an expression or property, you must use the alias.
Return to top
Return to Group records on intervals of date or time values on a data access page