Works: How to Print Database Reports in Month or Day Order (76417)



The information in this article applies to:

  • Microsoft Works 2.0
  • Microsoft Works 2.0a
  • Microsoft Works 3.0
  • Microsoft Works 3.0a
  • Microsoft Works 3.0b
  • Microsoft Works 4.5
  • Microsoft Works 4.5a
  • Microsoft Works for Windows 95, version 4.0
  • Microsoft Works for Windows 95, version 4.0 4.0a

This article was previously published under Q76417

SUMMARY

When using the Works Database module's report function, you may want to print your report in order of days or months (that is, all January dates, followed by February's, or all day one reports followed by day two reports, and so on).

However, if you entered the data in full date format (month, day, year), and the field is formatted as a date field, you are not able to sort your report by month or day in this date field. To sort the data in month or day order, do the following:

Works 3.0 for Windows and Works 4.0, 4.5, and 4.5a for Windows 95

  1. On the View menu, click List.
  2. Select the field containing the date information and from the Edit menu, click Select Field.
  3. Works 4.0, 4.5, and 4.5a for Windows 95:

    On the Record menu, click Insert Field and select After.

    Works 3.0:

    On the Insert menu, click Record/Field.
  4. Works 4.0, 4.5, and 4.5a for Windows 95:

    In the Insert Field dialog box, type the name of the field (Month or Day). Click Add, then click Done.

    Works 3.0:

    From the Edit menu, click Field Name. Rename the field to Month or Day.
  5. In the first record of the Month or Day field, type

    =Month(Date)

    where (Date) is the name of the field containing the date information.

    NOTE: If the field name is a reserved word, such as the word "Date" itself, place single quote marks before and after the field name in the formula, for example, =Month('Date').
  6. Works 4.0, 4.5, and 4.5a for Windows 95:

    On the Record menu, click Sort Records.

    Works 3.0:

    On the Tools menu, click Sort Records.
  7. In the first field box, select the Month or Day field. In the second field box select the Date field. Choose OK.
NOTE: To hide the Month Field, from the Format menu, click Field Width in Works for Windows 95, or Column Width in Works 3.0, and set the Width to zero (0). Make sure that the format of the Month field is set to General.

Works 2.0

  1. From the View menu, click List.
  2. From the Edit menu, click Insert Record/Field to insert a field next to the field containing the date.
  3. From the Edit menu, click Field Name, and enter the name "month" or "day" in the Name box.
  4. In the "month" or "day" field, enter the formula

    =MONTH(Date)

    for a month sort, or

    =DAY(Date)

    for a day sort, where (Date) is the name of the field containing the complete date (month, day, year). The above formulas return only the month or day from the (Date) field.
  5. From the View menu, click Create New Report. Sort on the "month" or "day" field, select the field, then delete it from the report screen.
The report will be in month or day order. The "month" or "day" field does not appear when you print the report, but the field containing the complete date does appear.

Modification Type:MajorLast Reviewed:11/15/2004
Keywords:kbhowto KB76417