K
Ken
I'm trying to open a querydef using a SQL statement that has multiple
criteria. My database has three locations: A, B and C. If I use the
following SQL statement, only the A locations are returned (which is correct):
Dim strSQL as string
strSQL = "SELECT * FROM tblPatients WHERE LocationFilter = 'A'"
CurrentDb.QueryDefs("qryPatientsLName").SQL = strSQL
However, if I try to query two locations using the following statement:
strSQL = "SELECT * FROM tblPatients WHERE LocationFilter = 'A' Or 'B'"
all THREE locations are returned. What am I doing wrong? Thanks.
criteria. My database has three locations: A, B and C. If I use the
following SQL statement, only the A locations are returned (which is correct):
Dim strSQL as string
strSQL = "SELECT * FROM tblPatients WHERE LocationFilter = 'A'"
CurrentDb.QueryDefs("qryPatientsLName").SQL = strSQL
However, if I try to query two locations using the following statement:
strSQL = "SELECT * FROM tblPatients WHERE LocationFilter = 'A' Or 'B'"
all THREE locations are returned. What am I doing wrong? Thanks.