all groups > sql server programming > december 2003 >
You're in the

sql server programming

group:

Need help with DATE code


Re: Need help with DATE code Raymond D'Anjou (raydan)
12/31/2003 1:45:53 PM
sql server programming: [quoted text, click to view]
Look up Convert in BOL
Convert(char(8), getdate(), 112)

[quoted text, click to view]
Look up dateadd in BOL
dateadd(d, 3, getdate())

[quoted text, click to view]

Need help with DATE code George Morton
12/31/2003 6:39:47 PM
I want to create an 8 char string for today's date in the format 'YYYYMMDD'
using T-SQL <not VB>.
Also, is there functionality like DATEADD in VB for TSQL. How might you get
a date three days from now?

TIA and Happy New Year. George.

Re: Need help with DATE code Wayne Snyder
1/1/2004 10:53:14 AM
select convert(char(8), getdate(), 112)

will give you the yyyymmdd string you wish.

--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org


[quoted text, click to view]

AddThis Social Bookmark Button