sanjay.dakolia (10/22/2012)
hi i am new to sql and i have the following problemi am using the following query :
select cast (1157068800 as datetime)
but i am getting this error :
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
please help
thanks
sanjay
well it depends on what 1157068800 *means* doesn't it?
that looks a lot like a unix date, which is the # seconds since 01/01/1970:
/*
declare @NumSeconds int
SET @NumSeconds = 1157068800
select dateadd(second,@NumSeconds,'19700101')
*/
Lowell