Int to Date in SQL SERVER 2000 -
how convert int column ,birthdate( sample value 20090301) date column in format(01/03/2009) sql server 2000
i trying convert thing below
select * tabl cast(dob datetime)>='01/03/2009' gives error msg 8115, level 16, state 2, line 1 arithmetic overflow error converting expression data type datetime.
sql server doesn't allow cast int -> datetime directly, if you're sure can cast nvarchar first , cast date. question here's example
declare @test int = 20090301 select convert(datetime, cast(@test nvarchar), 112)
112 format mentioned, here's list of possible formats convert function.
Comments
Post a Comment