Hello,
We upgrade an application from SQL server 2000 to Sql Server 2005, now we facing problems with queries that have date fields for example
select * from table where datefield = '20/12/2007'
will return this error: " Msg 242, Level 16, State 3, Line 1 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
if I change the date value to '12/20/2007', it will work fine I can use convert to change the format, but that will require to change the code
I would like force sql server to work with default format as 'dd/MM/yyyy' not as American format, or something like auto start up with this command "set formatedate dmy"
Regards, Mohammed
|