Example of MS Access query condition

Source: Internet
Author: User

Examples of MS Access query criteria Reference:

Https://support.office.com/zh-cn/article/%E5%88%9B%E5%BB%BA%E5%92%8C%E8%BF%90%E8%A1%8C%E5%88%A0%E9%99%A4%E6%9F %a5%e8%af%a2-6da65fe1-0fc7-4a64-8ef0-c052cd4c3ec5

Select query Criteria Sample

The following table lists some sample criteria that you can use in a select query to ensure that you delete only the data that you want to delete. Some examples use wildcard characters.

Conditions

Role

> 234

Returns all numbers greater than 234. To find all numbers less than 234, use < 234.

>= "Cajhen"

Returns all records from Cajhen to the end of the alphabet.

Between #2/2/2010# and #12/1/2010#

Returns the date from February 2, 2010 to December 1, 2010 (ANSI-89). If the database uses the ANSI-92 wildcard character, use single quotation marks (') instead of the pound sign (#). For example: Between ' 2/2/2010 ' and ' 12/1/2010 '.

Not "Germany"

The exact contents of the lookup field are not exactly equal to all records of "Germany". This condition returns records that contain characters other than "Germany", such as "Germany (euro)" or "Europe (Germany)".

Not "t*"

Finds all records that do not start with T. If the database uses the ANSI-92 wildcard character set, use the percent sign (%) Replace the asterisk (*).

Not "*t"

Finds all records that do not end with T. If the database uses the ANSI-92 wildcard character set, use the percent sign (%) Replace the asterisk (*).

In (Canada, United Kingdom)

In the list, look for all records that contain "Canada" or "UK".

Like "[a-d]*"

In the text field, look for all records that begin with the letters A through D. If the database uses the ANSI-92 wildcard character set, use the percent sign (%) Replace the asterisk (*).

Like "*ar*"

Finds all records that contain the alphabetical sequence "ar". If the database uses the ANSI-92 wildcard character set, use the percent sign (%) Replace the asterisk (*).

Like "Maison Dewe?"

Find all records that begin with "Maison" and contain another 5-letter string with the first 4 letters of the string "Dewe" and the last letter unknown. If the database uses the ANSI-92 wildcard character set, use an underscore (_) instead of a question mark (?).

#2/2/2010#

Find all records for February 2, 2010. If the database uses the ANSI-92 wildcard character set, enclose the date (' 2/2/2010 ') with single quotation marks instead of pound sign (#).

< Date ()-30

Use the DATE function to return all dates that are longer than 30 days.

Date ()

Use the DATE function to return all records that contain the current date.

Between date () and DateAdd ("M", 3, Date ())

Use the date function and the DATEADD function to return all records between the current date and three months from the current date.

Is Null

Returns all records that contain null (empty or undefined) values.

is not Null

Returns all records that contain any value (not null).

""

Returns all records that contain a 0-length string. You can use a 0-length string when you need to add a value to a required field but don't know what the actual value is. For example, a field may require a fax number, but some customers may not have a facsimile machine. In this case, you can enter a pair of double quotation marks ("") with no spaces in place of thenumber.

Example of MS Access query condition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.