Date in query

  • Thread starter Thread starter urbecar
  • Start date Start date
U

urbecar

Guest
In access 2002 i'm trying to create DAO recordset from this query

SQLString = "SELECT * FROM [izposoja] WHERE (datum_posoje) LIKE " & Date

i get the following error

The table IZPOSOJA looks like this

Basicly i yust wont to make a recordset of all records in IZPOSOJA where date is like todays date.


Well sorry for my english .... but i did my best :o
 
Write ur query like this
SQLString = "SELECT * FROM [izposoja] WHERE [datum_posoje] = #" & Date & "#"
 
Thanx for reply krunalprajapati.

I did what u wrote me. Now i get the following error

Run-time error'3075':
Syntax error in date in query expression '[datum_posoje] =#4.6.2005#'

Do i have to put anyreferences for that sql to work (like "Microsoft DAO 3.6. Object library" for DAO recordset) ?

P.S.: does error of this sql make any sense to u?
 
Last edited:
Never mind any more. I get answer from another forum.

Tanx for help krunalprajapati

solution is:

"SELECT * FROM izposoja WHERE datum_posoje >= Date()"
 
Urbecar
"Syntax error in date in query expression '[datum_posoje] =#4.6.2005#'"
The expression should have been [datum_posoje]=#4/6/2005#.The solution you found works only when the criteria is current date.Krunalprajapati's works for any date provided proper date format is used
vengsiva
 

Users who are viewing this thread

Back
Top Bottom