FireViking
Programmer
Hi all,
I have a query written in code to count records within a table. The query needs to pull information on 4 criteria.
I can get the query to work on 2 criteria but as soon as I try the third it fails.
The code is as follows:
Set rs.openrecordset("Select * from tblSummons where CaseWon = False and CustomerID =" & CustomerID)
this code works fine. I need to add 2 more criteria, those being CaseLost and Withdrawn.
I have tried
Set rs.openrecordset("Select * from tblSummons where CaseWon = False or CaseLost = False and CustomerID =" & CustomerID)
is the "or" the correct syntax or do I need brackets?
I am sure that this is not the right syntax so if any one can help it would be appreciated.
I have a query written in code to count records within a table. The query needs to pull information on 4 criteria.
I can get the query to work on 2 criteria but as soon as I try the third it fails.
The code is as follows:
Set rs.openrecordset("Select * from tblSummons where CaseWon = False and CustomerID =" & CustomerID)
this code works fine. I need to add 2 more criteria, those being CaseLost and Withdrawn.
I have tried
Set rs.openrecordset("Select * from tblSummons where CaseWon = False or CaseLost = False and CustomerID =" & CustomerID)
is the "or" the correct syntax or do I need brackets?
I am sure that this is not the right syntax so if any one can help it would be appreciated.