WHERE is the most used command in SQL, providing easiest way to pull out specific data from table. Even though you can use SQL commands in Access 2010, but CLI (Command Line Interface) brings monotony along and database novices usually get their hands on a tool which offers simple GUI layout. So the best alternative around in Access is to use wildcard entries, aka, Like/Unlike conditions, which offers innumerable ways of pulling out desired info from tables, queries, etc.
To begin with, launch Access 2010 and navigate to Create tab and click Query Design.
For illustrating using Wildcards in Access, we have created Student Grading database having multiple tables. Now we will be adding these tables in Query Design. Upon click Query Design, Show Table dialog will appear, listing tables contained in database. Double-click table(s) which you want to insert and click Close.
It will insert table with their fields in a box, now start adding table fields in Query design bottom pane by double clicking desired table fields in respective table box.
Now we want to view all the relevant information about students who secured A grade. For this, we will be using a wildcard entry. From Grade Secured field, we will write LIKE condition in Criteria row.
Under Query Tools Design tab, click Run to execute the query.
One executing Query, It will show all the students who secured A grade.
For instance, we need to view all the students having phone numbers starting with ‘13’. For this we will write this wildcard entry under Phone No field.
The asterisk at the end indicates that we want to find out record in field, having same starting value(s) i.e in our case it is 13.
On running query, it will promptly show us all the students having phone numbers starting with specified numbers.
We also like to know how which basic courses students have studied, for this, we will be adding Course table and add Course name in Query Design bottom pane.
Now will be writing asterisk wildcard entry, under Course Name field.
which goes like this;
On running Query, it will show only basic courses, i.e, title starting with ‘Intro’
From Wildcard examples demonstrated in aforementioned database, you might get an idea of having endless ways to manipulate the table fields, as it gives you more firm control over database and brings ease to pull out data instantly.
You might be interested in some other ways of using Wildcard entries in database;
Not Like “13*” It would return all the field data except data starting with ‘13’
Like “*13” It would return field data end with values 13.
Like “J?” It would return two characters’ data starting with J.
Like “J#” It would return all the two characters’ value starting with J and where second character is a number.
You can also check out previously reviewed guides on Using Expression Builder in Access 2010 & How to set Query Criteria in Access 2010 through Logical Operators.