June 27, 2007 at 9:04 am
June 27, 2007 at 9:15 am
It depends on the SET DATEFORMAT setting.
If unsure, always use ISO date format YYYYMMDD or YYYY-MM-DD.
In your case, since SQL Server cannot interpret last string as ISO, it tries MDY first, which yields month 20 and day 6 which gives an error.
set
dateformat dmy
select
cast('20070620' as datetime)
select cast('20-06-2007' as datetime)
N 56°04'39.16"
E 12°55'05.25"
June 27, 2007 at 10:03 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy