Criteria Mismatch

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I'm receiving a criteria mismatch on this statement. It worked fine until I
added the ChkSepCheck=-1 part.
It's a true false field.

Set rs2 = CurrentDb.OpenRecordset("SELECT Count(*) FROM " & _
"tblChecks " & _
"WHERE And ChkBizDay BETWEEN " &
Format(Forms!frmReportDates!TxtStart, "\#yyyy\-mm\-dd\#") & _
"AND " & Format(Forms!frmReportDates!TxtEnd, "\#yyyy\-mm\-dd\#") And
ChkSepCheck = -1, dbOpenSnapshot)

Thanks
DS
 
DS
there are a couple of syntax errors in the where statement.
I removed the And between the WHERE and the chkBizDay
I added an ampersand and some quotes for chkSepCheck

"WHERE ChkBizDay BETWEEN " &
Format(Forms!frmReportDates!TxtStart, "\#yyyy\-mm\-dd\#") & _
"AND " & Format(Forms!frmReportDates!TxtEnd, "\#yyyy\-mm\-dd\#") &
"AND ChkSepCheck = -1"



Jeanette Cunningham -- Melbourne Victoria Australia
 
I'm pleased I was able to help you get it working.


Jeanette Cunningham -- Melbourne Victoria Australia
 
Back
Top