covert date to int sql server 2005

Greens8301
Greens8301 used Ask the Experts™
on
I like to convert current day (todays) date to yyyymmdd

Example today will be 20090717

I need a help on a query to do this

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database Consultant
Top Expert 2009
Commented:
SELECT CONVERT(varcharm getdate(), 112)
Most Valuable Expert 2014
Commented:
He had a typo:

SELECT CONVERT(varchar, getdate(), 112)

But give him the points.

Author

Commented:
I get this message
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'getdate'.

Please advice
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

AneeshDatabase Consultant
Top Expert 2009

Commented:
SELECT CONVERT(varchar,  getdate(), 112)

sorry typed m for the comma
Most Valuable Expert 2014

Commented:
Glad to be of assistance. May all your days get brighter and brighter.
AneeshDatabase Consultant
Top Expert 2009

Commented:
Thankd Jim, its all becuase of multi-tasking :)
Aneesh

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial