need Help with multiple sql criteria (1 Viewer)

Rand

Registered User.
Local time
Today, 11:09
Joined
Jul 28, 2013
Messages
17
combo 86 is text and i keep getting an error see attached image
the numbers are date serial numbers. it works if i dont use the combo86 clause
the syntax is as follows:
strSQL = "SELECT Qry_CalDataBS.dte,Qry_CalDataBS.bs "
strSQL = strSQL & "FROM Qry_CalDataBS "
strSQL = strSQL & "WHERE Qry_CalDataBS.bs = '" & Me.[Combo86] & "' "
strSQL = strSQL & "WHERE (Qry_CalDataBS.dte) Between " & lngFirstOfMonth & " And " & lngLastOfMonth & " ORDER BY "
strSQL = strSQL & "Qry_CalDataBS.dte;"

it is from a populated calendar i got somewhere and trying to modifyy it to show just certain records based on the combo 86 dropdown.
tnx
 

Attachments

  • Capture.JPG
    Capture.JPG
    22.6 KB · Views: 75

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:09
Joined
Aug 30, 2003
Messages
36,126
You can only have one WHERE clause, but it can have multiple criteria separated by AND or OR.
 

Users who are viewing this thread

Top Bottom