Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Queries > PARAMETER AND CROSSTAB QUERIES

4.3. PARAMETER AND CROSSTAB QUERIES

4.3.1. Parameter Queries with Wildcards

THE ANNOYANCE: I have a simple parameter query that lets users input a phone number and receive any matching records. But I can't figure out how to make the query use wildcards.

THE FIX: The trick is using the Like operator. (It's hard to find, but the Like operator is documented in Help: see Microsoft Jet SQL Reference → Overview → SQL Expressions. (In Access 2000, on the Index tab, search for "Like.") If you want users to enter the wildcard characters, put Like [Enter phone number] in the Criteria line of the phone number field. If a user enters 212*, she'll get all the phone numbers that begin with 212. Enter # to match any single digit, and ? to match any single alphanumeric character. For instance, entering 21#-323-4100 returns 210-323-4100, 211-323-4100, and so on.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint