Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO Query

Status
Not open for further replies.

colobill

Programmer
Dec 16, 2003
22
US
I am using VB 6 in querying a table in an Access DB. I have the following query I cannot get to give me the desired results:

"SELECT * FROM SLPT WHERE AP = 'x' AND CONCEPT = 'Phonics - Alphabet Recognition' OR CONCEPT = 'Phonics - Print Awareness' OR CONCEPT = 'Phonics - Letter Sound"

What is important is the AP = 'x'. I want that to be the primary filter in the query. But it ends up giving me results like it is a bunch of ORs. It is as though the OR statements are ultimately given precedence over the AP = 'x'.

If this makes any sense to anyone, can you make a suggestion of how I can get this to work.
 
I just changed the statement where there is a series of OR statements and then a final AND statement but it still did not work. So if you have if A=B OR A=C OR A=D AND XYZ = 1, how do you get this to work to use any or all the OR statements PLUS the AND statement?
 
nevermind. I fixed it. I grouped all the OR statements with parentheses and it worked. Nothing like talking to yourself and figuring out something on a forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top