-- Removing time from a datetime field in SQL
- SELECT CAST(CONVERT(VARCHAR, GETDATE(),105) AS DATETIME)
- SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)
- SELECT CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME)
Prima: 2013-01-01 14:42:18.177
Dopo: 2013-01-01 00:00:00.000
Nessun commento:
Posta un commento