Queries

durdle

Registered User.
Local time
Today, 20:30
Joined
May 7, 2002
Messages
130
I am running a query with multiple criteria set on 3 different fields in the query. The first field which is named Valid(I only want the No, so the criteria set on this field is "N"). The second field is State(When I run the query I only want Flordia, so I got criteria set as Like "Flordia" for this field). The third field is Issue(I have multiple criteria set here which are "Not Valid" &/or "No Appointment"). When I run the query it returns nothing from my Main Data table, but I know there is data it should return. When I take out all criteria execpt Like "Flordia" it returns data. Any sugguestions(or more info) please let me know.I can also use a Instant Mesager.

Thanks

[This message has been edited by durdle (edited 05-09-2002).]
________
v transmission
 
Last edited:
When you use multiple criteria in a query column, remember that it is the OR of all items in the column but the AND of every item in the same row of the criteria set.

So if your first criteria row reads "N", "FL", test-1 and your second row reads blank, blank, test-2, your REAL SELECT clause is

SELECT whatever FROM whereever WHERE
(([Valid]="N") AND ([State]="FL") AND (test-1))
OR
(test-2);

Note carefully the parentheses and what is being grouped.

You probably want to replicate the other criteria in each query grid column, varying only the contents of the third column.

Or, you could write it in SQL (using the above as a template) with the exact requirements and could then switch back to the query grid to see how Access set that up.
 

Users who are viewing this thread

Back
Top Bottom