Daily Archives: 28.11.2011
SQL Server: Получить время в формате (hh:mm) из datetime
Для SQL Server 2005
1 2 3 |
CONVERT( VARCHAR( 8 ), GETDATE(), 108 ) AS HourMinuteSecond, -- hh:mm:ss CONVERT( VARCHAR( 5 ), GETDATE(), 108 ) AS HourMinute, -- hh:mm CONVERT( VARCHAR( 8 ), GETDATE(), 101 ) AS DateOnly -- mm/dd/yyyy |
http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/