Microsoft KB Archive/63644

Works: Querying on Dates

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

1.00 1.05 2.00 3.00

MS-DOS

=
========================================================= 1.00 1.05 2.00 3.00 MS-DOS kbother

= SUMMARY =

You can use the DAY, MONTH, and YEAR functions to query on dates in a document in the Works Database module.

To query on a day, use the following formula:

=DAY(date fieldname) (logical operator) (number)

For example, if the field containing the complete date is named “Date1”, then the query “=DAY(Date1)>1” will display all records with the day greater than 1.

Note: In Works version 3.0, if the date field has the same name as a Works function, such as Date or Year, the field name inside of the function must be enclosed in single quotation marks, for example, =MONTH(‘Date’). This is not necessary in earlier versions.

To query on a month, use the following formula:

=MONTH(date fieldname) (logical operator) (number)

For example, =MONTH(date1)=2 will display all records for the month of February.

To query on a year, use the following formula:

=YEAR(date fieldname) (logical operator) (number)

For example, =YEAR(date1)=65 will display all records for the year 1965.

KBCategory: kbother KBSubcategory: dworkskb

= Additional reference words: 1.00 1.05 2.00 3.00 =

Version : 1.00 1.05 2.00 3.00 Platform : MS-DOS ============================================================================= Copyright Microsoft Corporation 1998.