I want to get only Time from DateTime column using SQL query using SQL Server 2005 and 2008 Default output:
AttDate
==
2011-02-09 13:09:00
2011-02-09 14:10:00
I'd like this output:
AttDate Time
==
2011-02-09 13:09:00 13:09
2011-02-09 14:10:00 14:10
SQL Server 2008:
SELECT cast(AttDate as time) [time]
FROM yourtable
Earlier versions:
SELECT convert(char(5), AttDate, 108) [time]
FROM yourtable