I have a problem in SQL Server 2008 R2. I want to get HH:mm
from a DATETIME2
column. When I write this statement:
SELECT CONVERT(VARCHAR(5), getdate(), 8)
I am getting perfect result that is 11:19
, but when I try to get time from:
SELECT (CONVERT(VARCHAR(5), '1900-01-01 01:10:00.0000000', 8))
I am getting result 1900
but I need 01:10
.
How can I get the result from this statement? I know there there are multiple questions/answers like this but I have not found any answer that matches my question.