January 22, 2008 at 1:09 am
Hi All,
I need help about the syntax of the sql as below
When I try to Execute the tsql as below I get the error message
declare @IlkTarih datetime
set @IlkTarih='01.01.2008'
select dateadd(dd,1,convert(datetime,@IlkTarih,103))
Msg 242, Level 16, State 3, Line 5
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
Kind regards
January 22, 2008 at 1:19 am
I don't think points are valid date separator for style 103.
N 56°04'39.16"
E 12°55'05.25"
January 22, 2008 at 2:06 am
vyas (1/22/2008)
I am able to execute without any problem. I tried on sql server 2005See the following code
declare @a datetime
set @='01.01.2008'
select dateadd(dd,1,convert(datetime,@a,103))
This post is in SQL Server 2000 forum ;).
I tried it in 2000 and it seems to be working. Is it anything related to SET options (Ansi...) etc although i tried that also.
"Keep Trying"
January 22, 2008 at 5:04 am
I hate cross posting...
Anyway, like I said on the other forum, the correct date format number is NOT 103... it's 104. Check out Books Online under CONVERT.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply