sql date query - date format

J

Julian

Hi

In a query with dates eg SELECT * FROM tblCustomers WHERE HireDate
< Date Value

can you use UK format for the date of dd/mm/yyyy or does it have to be in US
format of mm/dd/yyyy.

If it has to be in the US date how do you convert from UK to US formats and
the other way round.


Many thanks

Julian
 
J

John W. Vinson/MVP

Julian said:
Hi

In a query with dates eg SELECT * FROM tblCustomers WHERE
HireDate < Date Value

can you use UK format for the date of dd/mm/yyyy or does it have to be in
US format of mm/dd/yyyy.

Literal dates must be in US format. You can convert what the user enters in
accord with their computer's regional settings using the Format() function:

PARAMETERS [Enter cutoff date:] DateTime;
SELECT * FROM tblCustomers WHERE [HireDate] < Format([Enter cutoff date:],
"mm\/dd\/yyyy")

John W. Vinson
 
Top