Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 dates

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-12-04 : 08:08:49
LINDA writes "I need to have dates appear as yyyymmdd. What do I use to format dates this way (they currently appear as mmddyyyy)."

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2003-12-04 : 08:26:36
DECLARE @myDate DATETIME

SET @myDate = '08/23/1978' -- 23rd August 1978

SELECT CONVERT(CHAR(10), CONVERT(DATETIME, @myDate), 112) -- YYYYMMDD

________________
Make love not war!
Go to Top of Page
   

- Advertisement -