AlphaPress Publishing
P.O. Box 5942 Albany, NY 12205
Tel: 518-250-3890
Email: alphapress@hotmail.com  


  
Click to buy this book from Amazon

Section Menu 

News

Pindaro is now working on a comprehensive book on SQL Server 2014.  For any comments you can email the author at alphapress@hotmail.com.

  

 

 

The ? wildcard in combination with *

To contact the author click here

This article is from the book "Access 2007 Pure SQL

To download the sample database click here


The ? wildcard character in combination with *

Create a customer list using ? and * to create intricate search patterns 

Discussion:

The ? character matches any single character.  Though not used as much as the *, it can still make the difference and enable us to get exactly the results we want in certain cases. Usually we use it in combination with other wildcard characters. For instance, let us say we want to find names starting with "Da", have any character after the "Da" pattern, and the next letter is "e" followed by any number of characters.  That is "Da?e*".  This will give us results such as Darec, Datek, Dale, and Daleney.    

Code:

SELECT *

FROM customers

WHERE ((lastname) Like "Da?e*")
 

Result: