Confused About Criteria

A

antmorano

Can anyone explain to me the logic behind criteria in queries? I
understand how to create them and the different words to use, but I
don't understand how Access actually uses it. To be even more
specific lets say I have one line of criteria that consists of
something like a retiree cannot be over the age of 65 and cancelled
cannot be in its status of retiree field, but then on the next line of
criteria i have that in the status of retiree and status of spouse-
they both cannot be "cancelled" regardless of age and any other
factors. What I guess I don't understand is does Access take each
line of criteria as a separate entity? Meaning are all lines
independent of each other? The reason why I ask is because I am
finding it difficult to add in my 9 different scenarios without a
different person being taken out of my specific query. Any input
would be greatly appreciated.

-Anthony Morano
Pension Fund Intern
 
A

Amy Blankenship

Can anyone explain to me the logic behind criteria in queries? I
understand how to create them and the different words to use, but I
don't understand how Access actually uses it. To be even more
specific lets say I have one line of criteria that consists of
something like a retiree cannot be over the age of 65 and cancelled
cannot be in its status of retiree field, but then on the next line of
criteria i have that in the status of retiree and status of spouse-
they both cannot be "cancelled" regardless of age and any other
factors. What I guess I don't understand is does Access take each
line of criteria as a separate entity? Meaning are all lines
independent of each other? The reason why I ask is because I am
finding it difficult to add in my 9 different scenarios without a
different person being taken out of my specific query. Any input
would be greatly appreciated.

This does not explain anything, but you may be able to use it to deduce the
answer to your question. http://support.microsoft.com/kb/290178/
 
F

fredg

Can anyone explain to me the logic behind criteria in queries? I
understand how to create them and the different words to use, but I
don't understand how Access actually uses it. To be even more
specific lets say I have one line of criteria that consists of
something like a retiree cannot be over the age of 65 and cancelled
cannot be in its status of retiree field, but then on the next line of
criteria i have that in the status of retiree and status of spouse-
they both cannot be "cancelled" regardless of age and any other
factors. What I guess I don't understand is does Access take each
line of criteria as a separate entity? Meaning are all lines
independent of each other? The reason why I ask is because I am
finding it difficult to add in my 9 different scenarios without a
different person being taken out of my specific query. Any input
would be greatly appreciated.

-Anthony Morano
Pension Fund Intern

When using the Query Grid, if you enter criteria for different columns
on the same row, it will be considered as an AND criteria (Where
[LastName] = "Jones" AND [FirstName] = "Frank").
If you place the criteria for each column on different rows, then it
will be considered an OR criteria (Where [LastName] = "Jones" OR
[FirstName] = "Frank").

You can mix and match....
Where ([Lastname] = "Jones" AND [FirstName] = "Frank") OR [City] =
"Oakland"

The above will return records for "Frank Jones" or people who live in
"Oakland".

Note my added parenthesis to group the criteria, as it can also be
read as
Where [LastName] = "Jones" And ([FirstName] = "Frank" Or [City] =
"Oakland")

which will return records for all "Jones" and people named "Frank" or
who live in "Oakland".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top