Grouping on Time-based Data

Objective

After completing this lesson, you will be able to group data based on a date field.

Data Grouping Based on Date and Time

Screenshot of a Change Group Options dialog box in a report-design application showing the Common tab with the instruction When the report is printed, the records will be sorted and grouped by: Orders.Order Date set to in ascending order, an unchecked Use a Formula as Group Sort Order checkbox, and an expanded The section will be printed: dropdown with for each year highlighted in blue among other interval choices (for each day, week, two weeks, half month, month, quarter, half year, for each second, minute, hour, and AM/PM).

Suppose you wanted a report that showed all employee names and their birth dates, but you wanted that report grouped by month. You would then have a list of those employees who have their birthdays in each month of the year. Or, you might need a report that shows all the orders placed, broken down by yearly quarters. You can group records by Date fields. When you apply grouping on a Date field, a second level of sorting options becomes available.

The first list gives you the option to select the field on which you want to base the groupings. You can pick the sort order in the second list. If you choose to base your groups on a date field, a third option will appear. In this third list, you can specify the frequency of the groups.

Hint

The options for formatting date, time, and date/time fields are extensive. You can also customize the settings to display a field based on your needs.

Group on a Date Field

In this exercise, you will perform grouping on a Date field.

Summary

  • Reports can be grouped by specific date fields, such as employee birthdays by month or orders by yearly quarters.
  • When grouping by a date field, you can specify the sort order through a second level of sorting options.
  • If you select a date field for grouping, an additional option to specify the frequency of the groups becomes available.