Microsoft KB Archive/78736

= Works: How to Query for Records Between Two Dates =

Article ID: 78736

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft Works 4.0 Standard Edition
 * Microsoft Works 4.0a
 * Microsoft Works 4.5a
 * Microsoft Works 2.0 Standard Edition
 * Microsoft Works 3.0 Standard Edition

-



This article was previously published under Q78736



SUMMARY
Use a formula to query for database records that are on or between two dates in Works for Windows. This article lists formulas for Works 2.x and 3.x, and for Works for Windows 95.



MORE INFORMATION
For records with dates between 1/1/89 and 2/15/89, use the formula below for your version of Works:

In Works for Windows 95
Filter Using Formulas:

 On the Tools menu, click Filters. Select the Filter using formula button at the top of the Filter dialog box. Type the formula:

='Fieldname1'>=&quot;1/1/89&quot;#AND#'Fieldname1'<=&quot;2/15/89&quot;

 Select the Apply Filter button.

To use the Easy Filter option:


 * 1) In the Filters dialog box, click the Field name.
 * 2) In the Comparison section, choose Is greater than or equal to.
 * 3) In the Compares To box type 1/1/89.
 * 4) Select the And option.
 * 5) In the second Field Name box, click the date field.
 * 6) In the Comparison section, choose Is less than or equal to.
 * 7) In the Compare To box, type 2/15/89.

In Works version 3.0x for Windows
To enter a query using Query View in Works for Windows version 3.0x:


 * 1) On the Tools menu, click Create New Query. Click the Query View button at the bottom of the Query dialog box.
 * 2) Type the formula >='1/1/89'#and#<='2/15/89' in the date field.
 * 3) To see the results, switch to list view by clicking the List button on the tool bar, or clicking List on the View menu.

To enter a query in the dialog box:


 * 1) On the Tools menu, click Create New Query.
 * 2) In Choose A Field To Compare, select the date field.
 * 3) In How To Compare The Field, select Is greater than or equal to.
 * 4) In Value To Compare The Field, type 1/1/89.
 * 5) In Choose A Field To Compare, select the date field.
 * 6) In How To Compare The Field, select Is less than or equal to.
 * 7) In Value To Compare The Field, type 2/15/89.

In Works version 2.0x for Windows
To enter a query in Works for Windows version 2.0x:


 * 1) Click the Query button on the tool bar, or click Query on the View menu.
 * 2) Type the formula >='1/1/89'&<='2/15/89' in the date field.
 * 3) To see the results of the query, click the List button on the tool bar, or click List on the View menu.

