SQL Query Parenthesis Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to get this query to work using the Filter Mgmt Form and continue
to get missing operator and syntax errors.

Any help would be greatly appreciately.


(((Region="New York") AND ((tblTask.AssignedTo="last name, fn")) OR
(tblTask.AssignedTo="nameâ€) OR (tblTask.AssignedTo="name") OR
(tblTask.AssignedTo="name") OR (tblTask.AssignedTo="name")) AND (Not
tblTask.Status="Completed")))
 
Well, I'm not really sure what you are doing or why you have
(tblTask.AssignedTo="name") repeated four times. But I *do* know that you
have 10 left parens and 11 right parens.

You can get rid of a bunch of superfluous parens and only keep the ones
necessary to show correct order of precedence. Assuming you want all the
ORs grouped together, I'd say something like this would be appropriate:

(Region="New York") AND (tblTask.AssignedTo="last name, fn" OR
tblTask.AssignedTo="name" OR tblTask.AssignedTo="name" OR
tblTask.AssignedTo="name" OR tblTask.AssignedTo="name") AND (Not
tblTask.Status="Completed")


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Back
Top