Microsoft KB Archive/65513

Works: Querying on Multiple Date Fields

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

2.00 3.00

MS-DOS

=
========================================================= 2.00 3.00 MS-DOS kbother

= SUMMARY =

In Microsoft Works for MS-DOS, queries entered in separate fields in the View Query screen have the effect of linking the queries with an AND operator. To achieve an OR link, the individual query conditions must be entered into one field, with each condition separated with the OR operator. For example, if a database has several fields that include dates (for example, birthday, graduation, and anniversary fields) and you need a query to return all the records for January, only one field can have the query formula.

= MORE INFORMATION =

The AND and the OR operators vary according to Works version:

Works 2.0   Works 3.0 -   - AND operator & #AND# OR operator | #OR#

For example, to query on the month of January in three date fields (birthday, graduation, and anniversary), enter the following formula in the “birthday” field in View Query screen:

Works 2.0:

=MONTH=1|MONTH(graduation)=1|MONTH(anniversary)=1

Works 3.0:

=MONTH=1#OR#MONTH(graduation)=1#OR#MONTH(anniversary)=1

The “1” in this formula refers to the month of January; use “2” for February, and so on. After pressing ENTER and F10 (or choosing List or Form from the View menu), the above example shows all records containing a January date from the three fields listed.

KBCategory: kbother KBSubcategory: dworkskb

= Additional reference words: 2.00 =

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