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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversions 2

Status
Not open for further replies.

chkote

Technical User
Nov 21, 2000
42
AU
I have a database which contains "date" data in the format
'20010518'. Is there any way I can convert these to a true date format...e.g. 18/05/2001?
Any suggestions would be appreciated.
Thanks
 
Create a date column on the table. If the date column is named DateCol and the text column is name TextCol then the following query will store the converted date in DateCol.

Update table1 Set DateCol = DateSerial(Left(TextCol,4),Mid(TextCol,5,2),Right(TextCol,2)) Terry

;-) The single biggest challenge to learning SQL programming is unlearning procedural programming. -Joe Celko

SQL Article links:
 
Thanks Terry, with a couple of mods did the trick beautifully!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top