Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a number to a date

Status
Not open for further replies.

jconway

Programmer
Dec 14, 2005
50
I have my dates in a number format such as:
20070904
I need to convert it to a regular date (09/04/2007), but am having trouble. I'm using Convert, but I just can't seem to get the correct syntax.

Thanks in advance
 
First, convert to varchar, and then to date.

Code:
Select Convert(DateTime, Convert(VarChar(8), [!]20070904[/!]))

-George

"the screen with the little boxes in the window." - Moron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top