
December 6th, 2004, 06:04 AM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Date format problems
Hi, I'm having a date format problem with SQL
SET DATEFORMAT dmy SELECT * FROM project_date,project WHERE project_date.cms_id=project.cms_id AND project_date.dfrom<'01/03/2005' AND project_date.dto>'01/03/2005'
returns results for the 3rd of January but if I change the date to 13/03/2005 -
SET DATEFORMAT dmy SELECT * FROM project_date,project WHERE project_date.cms_id=project.cms_id AND project_date.dfrom<'13/03/2005' AND project_date.dto>'13/03/2005'
the results returned are for the 13th of March!!
this is true for all months - when the day of the month is over 12 SQL assumes the date format is dmy but if the day of the month is 12 or under then SQL is assuming that the date format is mdy.
This is totally perplexing...
any help/info would be greatly appreciated, thanks
|