Link to home
Start Free TrialLog in
Avatar of chunky1
chunky1

asked on

Format of date query in SQL statements.

My database explorer displays date formats as follows : DD/MM/YYYY

But when I use an SQL statement I have to input it as : MM/DD/YYYY

How can I change the layout that SQL will accept my query ?
Avatar of Asw
Asw

Listening
Avatar of chunky1

ASKER

Edited text of question.
Avatar of kretzschmar
hi chunky1,

the best and format-independent method is to use a parameter, like

the sql-statement sample
select * from ATable where ADateField = :TheDate

now u can use following code:

queryname.parambyname('TheDate').AsDateTime := TDateTimeVar
queryname.Open;

meikl
ASKER CERTIFIED SOLUTION
Avatar of florisb
florisb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chunky1

ASKER

Why didn't I think of that ?