Andy Dufresne
2013-08-30 14:29:53 UTC
I have a bigint column in a table that contains a unix timestamp. I can convert that timestamp to a "human" date using the DATEADD() function:
SELECT DATEADD(s, lastaccessdate, '19700101 00:00:00:000') AS lastaccessdate
FROM MyTable
Result:
lastaccessdate
2013-02-04 16:05:51.000
How can I get SQL Server to show just the date portion (and drop the time)? I want:
lastaccessdate
2013-02-04
Thanks.
SELECT DATEADD(s, lastaccessdate, '19700101 00:00:00:000') AS lastaccessdate
FROM MyTable
Result:
lastaccessdate
2013-02-04 16:05:51.000
How can I get SQL Server to show just the date portion (and drop the time)? I want:
lastaccessdate
2013-02-04
Thanks.