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

How to change a smalldatetime to a string?

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
I have a smalldate time (e.g. 2008-02-18 00:00:00.000) and want to create a string (e.g. 20080218), but whenever I use a substring for this, it wants to create a date such as Feb 18, 2008??

EO
Hertfordshire, England
 
Code:
SELECT CONVERT(varchar(8), GETDATE(), 112)

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top