Microsoft KB Archive/66251

Works: Breaking a Report by Month with a Date Field

PSS ID Number: Q66251 Article last modified on 10-16-1998

2.00 3.00

MS-DOS

=
========================================================= 2.00 3.00 MS-DOS kbotherdatabase reporting sorting

= SUMMARY =

If a date field has been chosen as the sort field in a report, the resulting report will separate each date individually. Often a report is needed where the data is separated by month.

To create a report that separates the data by month, a new field must be created in the database. The new field will contain a formula that will return the month number of the date. The following steps outline the creation of the new field and the formula:


 * 1) Choose List View, then move the cursor to the first blank cell to the right of the database.
 * 2) Choose Edit Field Name and enter the name of the new field (for example, Month).
 * 3) With the cursor on record 1 in the new field, type “=MONTH(fieldname)” (without quotation marks) where the fieldname is the name of the field that contains the date information. This will insert a number in the column that specifies what month it is (for example, Jan=1, Dec=12).
 * 4) Choose View Report (Alt, V, R) (choosing either New Report or an existing report number).
 * 5) Choose Select Sort Records (Alt, S, O) from the menu and type in the name of the newly created field (for example, Month) as the first field to sort on.

The resulting report will break on the month.

= MORE INFORMATION =

Works stores dates in serial number form (representing the number of days since January 1, 1900). Therefore, each date has a different number. The result is that when sorting in the database report, each individual date will cause a break.

KBCategory: kbother KBSubcategory: dworkskb Additional reference words: ====================================================================== Version : 2.00 3.00 Platform : MS-DOS ============================================================================= Copyright Microsoft Corporation 1998.