Microsoft KB Archive/60380

Works: Database Query Examples

PSS ID Number: Q60380 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 =

When you apply or carry out a query, Works finds and displays the records that match your query instructions. In List view, you can see several records at one time. In Form view, you see one matching record at a time. Each time you apply a query, Works searches all your records, including the hidden ones.

To create a query, select Query from the View menu. (In Works 1.x select Define from the Query menu.) Works displays your form with each field left blank. You enter your query criteria into the blank fields.

To apply your query, choose List from the View menu (choose Exit Query from the Edit menu in Works 1.x), or press F10. A list of records matching the query is displayed.

To apply an existing query, choose Apply Query from the Select menu (from the Query menu in Works 1.x). This is useful in cases where you have applied a query once and have since edited records or entered new records. You can choose the Apply Query command to apply the query again to see which records now match the query formula.

The following are sample query criterion:

Operation Formula Used Finds These Records ——— ———— ——————-

Equal to text Smith or =“Smith” Last name is Smith

Equal to number 25 or =25 The number is 25

Begins with letter =&quot;J*&quot; Last name begins with “J”

Greater than >=“J” Last names begin or equal to with “J” or later

Greater than >=‘10/30/60’ The date is October 30, or equal to 1960 or later

Greater than >25 Number is greater than 25

Between (ver. 2.0) >10&<25 Greater than 10 and less (ver. 3.0) >10#AND#<25 than 25

Empty (ver. 2.0) ==0 Field is blank Empty (ver. 3.0) =&quot;&quot;

Non Empty (ver. 2.0) <>==0 Field is non-blank Non Empty (ver. 3.0) <>&quot;&quot;

Or (ver. 2.0) ==‘1/01/88’|=‘12/01/88’ Date is 1/01/88 or (ver. 3.0) ==‘1/01/88’#OR#=‘12/01/88’ 12/01/88

And (ver. 2.0) >=‘1/01/88’&<‘12/01/88’ Month is greater than or (ver. 3.0) >=‘1/01/88’#AND#<‘12/01/88’ equal to 1/01/88 and less than 12/01/88 Or with Month function (ver. 2.0) =month(field1)=10| Month is October or month(field1)=12 December (ver. 3.0) =month(field1)=10#OR#month(field1)=12

For more information, see the “Microsoft Works Reference” for 2.0, pages 222-226, or the “Microsoft Works User’s Guide” for 3.0, pages 314-324.

KBCategory: kbother KBSubcategory: dworkskb

= Additional reference words: 2.00 3.00 =

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