Converting a Character String into a Time Field

Question:
How do I convert a character string into a time field? Data is being read in as 12:10 and I need to calculate response times based on this field.

Answer:
Try this:

 SELECT CONVERT(CHAR(15), getdate())

or going the other way:

 SELECT CONVERT(DATETIME, "12/10/99")

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: