Multiple "Ors" in query

G

Guest

I have a query where I want to search multiple fields. I may want to search
criteria in all fields, or only one field. I searched the bulletin board and
learned that I need to place each criteria for each field on a different
line, which I've done. My "Where" sequel statement looks like this:

WHERE ((([T ReferenceIndex].Title) Like "*" & [Title Keyword] & "*") AND
(([Title Keyword])<>''))
OR ((([T ReferenceIndex].Author) Like "*" & [Author Name] & "*") AND
(([Author Name])<>''))
OR ((([T ReferenceIndex].Series_#) Like "*" & [Series_#] & "*") AND
(([Series_#])<>''))

Right now I'm getting a "syntax" error message and am unclear why. If I
remove the last "Or" criteria, the query works fine.

I'd appreciate your help.
 
G

Guest

Your number of opening and closing parenthesis do not match for eachpart of
the where statement.
 
G

Guest

Thank you Karl. Sometimes it's the most (now) obvious things that stump me.

KARL DEWEY said:
Your number of opening and closing parenthesis do not match for eachpart of
the where statement.
--
KARL DEWEY
Build a little - Test a little


GIraffe said:
I have a query where I want to search multiple fields. I may want to search
criteria in all fields, or only one field. I searched the bulletin board and
learned that I need to place each criteria for each field on a different
line, which I've done. My "Where" sequel statement looks like this:

WHERE ((([T ReferenceIndex].Title) Like "*" & [Title Keyword] & "*") AND
(([Title Keyword])<>''))
OR ((([T ReferenceIndex].Author) Like "*" & [Author Name] & "*") AND
(([Author Name])<>''))
OR ((([T ReferenceIndex].Series_#) Like "*" & [Series_#] & "*") AND
(([Series_#])<>''))

Right now I'm getting a "syntax" error message and am unclear why. If I
remove the last "Or" criteria, the query works fine.

I'd appreciate your help.
 

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

Top