Where Clause

cpampas

Registered User.
Local time
Today, 05:29
Joined
Jul 23, 2012
Messages
221
Hello

Set rstNotDatas = db.OpenRecordset("SELECT * FROM tblDatasRec " & _
"WHERE DataRec=" & (Date))

I am trying to create a recordset in wich the field DataREc (data type) is equal to the present day. It returs zero records, but I hace 15 records in my table with todays date
Something to do with formatting the date ? my format is 09/05/2014

Thanks
 
Try,
Code:
Set rstNotDatas = db.OpenRecordset("SELECT * FROM tblDatasRec " & _
                                   "WHERE DataRec = " & Format(Date, "\#mm\/dd\/yyyy\#"))
 
Paul,
Thanks a lot for your help, it works fine
Carlos
 

Users who are viewing this thread

Back
Top Bottom