I have two queries
use [DatabaseAA]
select *
,DATEDIFF(MINUTE,SomeDate,'3/28/2012 12:52:25 PM +00:00')
This passes, while the same query when executed against another database fails.
use [DatabaseBB]
select *
,DATEDIFF(MINUTE,SomeDate,'3/28/2012 12:52:25 PM +00:00')
fails in the DatabseBB
Both the sometime has same values. It is failing for the 3 parameter to the datediff. Any ideas why this is the case ?
The error message is
Msg 241, Level 16, State 1, Line 5
Conversion failed when converting date and/or time from character string.
That will fail if the database’s compatibility level is 80 or 90 (SQL 2000/5) you need to set it to 100 for SQL 2008.