Microsoft KB Archive/141998

= Works FAQ: Database Filtering =

Article ID: 141998

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Works 6.0
 * Microsoft Works 2000 Standard Edition
 * Microsoft Works 4.5 Standard Edition
 * Microsoft Works 4.0 Standard Edition

-



This article was previously published under Q141998



SUMMARY
This article contains answers to frequently asked Database filtering questions.



MORE INFORMATION
 Q. How do I perform text queries (called filters) in Works?

A. In a very large database, it may be useful to perform a filter that has Works show on screen only records that match criteria you specify. For example, you can have Works show only records that have a value in a State field of WA, or only records for customers whose first name is Betty.

To create a filter in the Works for Windows 95 database, follow the steps below.

NOTE: This example shows the steps to use if you want to find all of the people named "Betty" in an open database that contains a field called "First Name".

 On the Tools menu, click Filters. You might need to name the filter before proceeding to step 2. In the Field name box, select the First Name field. In the Comparison box, select the appropriate operator, for example, "Is Equal To" or "Contains". In the Compare To box, type search target information. For example, Betty . Click Apply Filter.</ol> </li> Q. How do I filter on a blank field?

A. To perform a filter on a blank field, follow the steps below:

<ol> Follow steps 1-2 in Question 1 of this article.</li> In the Comparison box, select the operator Is Blank.</li> Click Apply Filter.</li></ol> </li> Q. How do I filter on a range of dates?

A. You can filter on a range of dates by using the AND operator in conjunction with two comparison statements. For example, if you want to find all records whose date falls from 7/1/93 to 9/30/93, follow the steps below :

<ol> On the Tools menu, click Filters.

If you have not created any filters with this database file, name the filter and click OK. If you have already created a filter, click New Filter. Name the filter, and click OK.</li> In the Field name box, select the Date field.</li> In the Comparison box, select Is Greater Than Or Equal To.</li> In the Compare To box, type the starting range of the date. For example:

7/1/93

</li> Select the AND operator in the far left box of the second row.</li> Repeat step 2 on the second row of query criteria.</li> On the second row of query criteria, repeat step 3, but select Is Less Than Or Equal To.</li> On the second row of query criteria, repeat step 4, but type the ending range of the date. For example, type the following:

9/30/93

</li> Click Apply Filter.</li></ol> </li> Q. How do I filter on a specific month?

A. In the Works Database module, you can filter for dates that fall in a particular month with the MONTH function. The MONTH function returns an integer from 1 to 12 specifying the month of the given date. For example, if you need to find records that have May in a field named "Birthday," use the steps below:

<ol> On the Tools menu, click Filters. If you have not created any filters with this database file, name the filter and click OK. If you have already created a filter, click the New Filter button. Name the filter and click OK.

</li> <li>Select Filter Using Formula.</li> <li>Enter the following formula in the box:=month(birthday)=5</li> <li>Click Apply Filter.NOTE: This example will match all records where a date entry contains a month of May, regardless of the year. To find records in a certain year, use the YEAR function. For example, to find records only for May of 1995, use the following formula:

=month(birthday)=5#and#year(birthday)=95

</li></ol> </li></ol>

Additional query words: 4.00 4.50 w_works works2k works6 kbfaq ranges queried searches searching locating sorting

Keywords: kbfaq kbinfo KB141998

-

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

© Microsoft Corporation. All rights reserved.