Wednesday, September 19, 2012

Query criteria, part 1: Be specific!

(This article was published for the first time in August 2011 and is the first in a series of posts on the use of query criteria that contains query criteria part 2: what? and query criteria part 3: prompt for a parameter.)

Queries are an essential part of developing and using any database. Provides a way to bulk changes to your data make, they are questions about this data as you. Query criteria help your question more precisely - so instead of wondering "What are birthdays of my contacts?" Could issues ", have until next month birthday?"

We look at these issues in access us. The first question is a very simple query of a single table (contacts). It asks only access to the name and date of birth of each in the table select:

When I start it, I get the full list:

Very basic stuff. In this example, I have to see a huge list, but imagine I had hundreds of contacts.  I would look very often that probably not interested in all their birthdays. Now let's see, a criterion can use such as I, the more useful question: whose birthdays are this month?

Here is the query design again, only this time I've added an expression in the row to criteria of the field DOB:

 

Now, when I run the query, I see only people, Geburtstage are in this month:

Read more about how queries work criteria and get a comprehensive set of examples in the article examples of query criteria. If you want to see this sample something slightly more complex but love to read this YouTube video to show only those contacts whose Geburtstag is today.

Earlier in the series: using of similar and wildcards in query criteria.

--Steven Thomas


View the original article here

No comments:

Post a Comment