Multiple "Ors" in query

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Your number of opening and closing parenthesis do not match for eachpart of
the where statement.
 
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.
 
Back
Top