Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Truncar a data para apenas hora/minuto

declare @D as datetime = '2012-01-02T12:04:11.443'

select dateadd(hour, datediff(hour, 0, @D), 0)
select dateadd(minute, datediff(minute, 0, @D), 0)