Convert SQL Time to get only Hour, Min & Sec

I want to convert a Column value whose type is Time to get only the time in the format HH:MM:SS. By default, for, 19:10:00, it was returning, 19:10:00 0000000. Which was obviously not required. So in the SQL query I converted the Time Field to MilitaryTime

SELECT CONVERT(VARCHAR(8), ColumnNameWhoseTypeIsTime, 108) AS MilitaryTime FROM TableName

Happy Coding …

Advertisements