SQL time conversion

How do you convert time below. The data type is time(0):

09:00:00 to 9:00 AM
22:00:00 to 10:00 PM

Who is Participating?
Kent DyerConnect With a Mentor IT Security Analyst SeniorCommented:
Outside of the CAST/Convert

You can try the following FORMAT - http://msdn.microsoft.com/en-us/library/hh213505

Here is a real-life example - third response..

[ed. url removed, please see below]


barnescoAuthor Commented:
I totally disagree with the above. After 10 years on this site, I honestly don't think I've ever thought of subscribing to another one, until now.

SELECT convert(varchar, 22:00:00), 100) works

I think I was trying to make the value a string when it just needed to stay as a time data type.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.