Microsoft KB Archive/76287

= Works: Database Query Examples =

Article ID: 76287

Article Last Modified on 11/16/2006

-

APPLIES TO


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

-



This article was previously published under Q76287



SUMMARY
Before you print a report or view a database in Microsoft Works, you can define exactly which records you want to see by using a Query (Works 2.0 and 3.0) or Filter (Works 4.0 for Windows 95). With a Query or Filter, you can ask for specific field definition. In contrast, the Search command will check all fields and records for what you ask.



MORE INFORMATION
With Works for Windows 2.0 and 3.0, you select a specific group of records by typing one or more conditions in query fields. In Works 4.0, you can select Filter conditions in the Easy Filter dialog, or use the Filter using formula option. Each condition defines the text or values you want Works for Windows to look for.

The following is a list of operators, formulas, and the expected results.  Operator             Formula Used        Finds These Records ---

Equal to (=)         Smith or =&quot;Smith&quot;   Last name is Smith

Equal to (=)         25 or =25           The number is 25

Not Equal (<>)       <>&quot;Ca&quot;              Finds all states excluding Ca

Begins with =&quot;x*&quot;    =&quot;J*&quot;               Last name begins with &quot;J&quot;

Greater than         >=&quot;J&quot;               Last names beginning with or equal to (>=)                       &quot;J&quot; and after &quot;J&quot; alphabetically

Greater than                             The date is October 30, or equal to (>=)   >='10/30/60'        1960 or later

Greater than (>)     >25                 Number is greater than 25

Empty Works 2.0:         ==0                 Field is blank Works 3.0 and 4.0: =fieldname=&quot;&quot;

Non Empty Works 2.0:         <>==0               Field is nonblank Works 3.0 and 4.0: =fieldname<>&quot;&quot; Works for Windows will also work with multiple arguments and functions. The following are examples using OR and AND operators.


 * In Works 2.0, the OR operator is a straight vertical line (|), known as the pipe character, and the AND operator is the ampersand (&).


 * In Works 3.0 and Works 4.0, the OR operator is #OR#, and the AND operator is #AND#.

NOTE: In the examples below, if you are using Works 3.0 or later, substitute #AND# and #OR# for the & and | operators, respectively.  Operator        Formula Used             Finds These Records ---

Or (|)          =fieldname='1/01/91'|    Date is 1/01/91 or                  fieldname='8/30/91'      8/30/91

And (&)         >='1/01/91'&<'8/30/91'   Month is greater than or                                           equal to 1/01/91 and less than 8/30/9

Between (>x&25&<75                  Greater than 25 and less than 75

Month function  =month(fieldname)=10|    Month is equal to the 10th month(fieldname)=12    month or the 12th month

Additional query words: 2.00 2.00a 3.00 3.00a 3.00b 4.00 4.00a 4.50 4.50a w_works

Keywords: kbinfo KB76287

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.