Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do i format a time '17:15:01.7730000' to '17:15' in sql server 2008 R2 ???
Posted

You can use
CONVERT(VARCHAR(5),[Date],114)


The 114 produces the date in the format hh:mi:ss:mmm (24h) and the VARCHAR(5) returns only the first 5 characters ... i.e. hh:mi
 
Share this answer
 
Comments
Andrius Leonavicius 23-Mar-14 12:16pm    
+5
CHill60 23-Mar-14 12:20pm    
Thank you
Sergey Alexandrovich Kryukov 23-Mar-14 12:40pm    
5ed.
—SA
CHill60 23-Mar-14 12:41pm    
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900