Criteria Mismatch

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
 
J

Jeanette Cunningham

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
 
J

Jeanette Cunningham

I'm pleased I was able to help you get it working.


Jeanette Cunningham -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Syntax Error 4
Are Nulls Covered? 2
Not returning a value 7
DCount In Otherdb 27
DCount Error 6
ISAM Error 2
From External Database 5
UNION QUERY (Sorting) 2

Top