This code shows how to do what you want. You need to be aware that the possible datetimes are 1753-01-01 00:00:00.000 through 9999-12-31 23:59:59.997, so the smallest and largest possible numbers you can convert this way are shown below.select *, New_Datetime = dateadd(ss,a.dt_int%86400,dateadd(dd,a.dt_int/86400,'19900101'))from ( -- Test Data select dt_int = convert(bigint,-7478956800) union all select dt_int = convert(bigint,617919719) union all select dt_int = convert(bigint,252771148799) ) aorder by a.dt_int
Results:dt_int New_Datetime-------------------- --------------------------7478956800 1753-01-01 00:00:00.000617919719 2009-07-31 20:21:59.000252771148799 9999-12-31 23:59:59.000(3 row(s) affected)
CODO ERGO SUM