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

DateTime

Status
Not open for further replies.

sardinka2

Programmer
May 6, 2004
38
0
0
US
I have the following datetime.
2004-04-21 16:24:36.790
I would like to display as:
20040421162436
How do I do this?
 
SELECT REPLACE( REPLACE( REPLACE( CONVERT( varchar, your_datetime_value, 120 ), ' ', '' ), ':', '' ), '-', '' )

Zhavic

---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top