pinky
pinky

Reputation: 193

How to convert timestamp to date&time in SQL?

Table have one column which contain timestamp value.I want to convert that timestamp value to date&time in SQL.

When I using like this

select cast(1520339311 as datetime)  

I'm getting an error:

Arithmetic overflow error converting expression to data type datetime

How to handle that?

Upvotes: 0

Views: 20962

Answers (1)

H Zeeshan Ali
H Zeeshan Ali

Reputation: 21

SQL Server's TIMESTAMP datatype has nothing to do with a date and time! See the links Below:

CAST and CONVERT (Transact-SQL)

rowversion (Transact-SQL)

Already Answered

Upvotes: 1

Related Questions