How to see this format hh:mm from hh:mm:ss in SQL Server 2008 query ?
How to see this format hh:mm from hh:mm:ss in SQL Server 2008 query ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no direct, built-in functionality for this.
Assuming you have a
DATETIMEorTIMEcolumn in SQL Server, you need to hack it like this:The
CONVERTstatement with style = 108 will convert your date tohh:mm:ssand then you just chop off the last three characters.Things like this really shouldn’t be done in the database – that’s purely presentation logic, and it belongs in the UI app.