Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Oct 29, 1999

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")
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap