Board index » delphi » dd.mm.yyyy format Error wiht adoquery

dd.mm.yyyy format Error wiht adoquery

I use win95,d5, ado 2.1 jet 4.0
I open a acces97 mdb table with Adoquery:
Select * from myTable where mydate=23.01.2001
A error raised, But I open ..where mydate=23/01/2001 not error.
Please help me. What I can open with dd.mm.yyyy dateformat.
 

Re:dd.mm.yyyy format Error wiht adoquery


try this:

select *
from myTable
where mydate = datevalue('23.01.2001')

Quote
Nimet Demir <nihat.yorga...@rt.net.tr> wrote in message

news:3c427c87_2@dnews...
Quote
> I use win95,d5, ado 2.1 jet 4.0
> I open a acces97 mdb table with Adoquery:
> Select * from myTable where mydate=23.01.2001
> A error raised, But I open ..where mydate=23/01/2001 not error.
> Please help me. What I can open with dd.mm.yyyy dateformat.

Re:dd.mm.yyyy format Error wiht adoquery


Jet (MS Access) requires using its date format when converting it to/from
string, even inside query. Only way you can do this is to use a parameter
and set it from TDateTime

Parameters d Date;
Select * from [myTable]
where [mydate]=d

And, by MS Jet specs, for your query you should write .... where
mydate=#23/01/2001#

Regards,
Vassiliev V.V.
http://www.oledbdirect.com

"Nimet Demir" <nihat.yorga...@rt.net.tr> ???Y/???Y ?????
???Y??: news:3c427c87_2@dnews...

Quote
> I use win95,d5, ado 2.1 jet 4.0
> I open a acces97 mdb table with Adoquery:
> Select * from myTable where mydate=23.01.2001
> A error raised, But I open ..where mydate=23/01/2001 not error.
> Please help me. What I can open with dd.mm.yyyy dateformat.

Other Threads