I've got a problem where my SQL string is finding dates in US format ie mm/dd/yy. All my forms, tables etc are dd/mm/yy ( my regional setting is dd/mm/yy). Reading the help file it says that all 'Date literals' in the criteria argument must be in US format. How do you acheive this when every other date is in UK format?
My code is as follows. All I want to do is find if the recordcount >0 of the found set as a check to an import procedure.
Dim strSQL as String
Dim rs as Recordset
Dim db as Database
strSQL = "SELECT Distinctrow from tblData WHERE DatetblData = #" & txtDate & "#" ' txtDate is Date from textbox on an unbound form
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
if rs.recordcount>0 then
blah blah
else
blah blah blah
My code is as follows. All I want to do is find if the recordcount >0 of the found set as a check to an import procedure.
Dim strSQL as String
Dim rs as Recordset
Dim db as Database
strSQL = "SELECT Distinctrow from tblData WHERE DatetblData = #" & txtDate & "#" ' txtDate is Date from textbox on an unbound form
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
if rs.recordcount>0 then
blah blah
else
blah blah blah