Works FAQ: Database Filtering (141998)



The information in this article applies to:

  • Microsoft Works 6
  • Microsoft Works 2000
  • Microsoft Works 4.5
  • Microsoft Works for Windows 95, version 4.0

This article was previously published under Q141998

SUMMARY

This article contains answers to frequently asked Database filtering questions.

MORE INFORMATION

  1. 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".

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

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

    1. Follow steps 1-2 in Question 1 of this article.
    2. In the Comparison box, select the operator Is Blank.
    3. Click Apply Filter.
  3. 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 :

    1. 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.
    2. In the Field name box, select the Date field.
    3. In the Comparison box, select Is Greater Than Or Equal To.
    4. In the Compare To box, type the starting range of the date. For example:

      7/1/93

    5. Select the AND operator in the far left box of the second row.
    6. Repeat step 2 on the second row of query criteria.
    7. On the second row of query criteria, repeat step 3, but select Is Less Than Or Equal To.
    8. 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

    9. Click Apply Filter.
  4. 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:

    1. 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.

    2. Select Filter Using Formula.
    3. Enter the following formula in the box:=month(birthday)=5
    4. 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


Modification Type:MajorLast Reviewed:11/15/2004
Keywords:kbinfo KB141998