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

Converting datetime to date

Status
Not open for further replies.

renee35

MIS
Jan 30, 2007
199
It's Friday and my brain is fried, could someone please tell me what needs to be done to the below formula to have it display a date only:

CONVERT(varchar(10), getdate() - 4, 101)

Thanks a bunch!!

-T
 
Try:

CONVERT(DATETIME, CONVERT(varchar(10), getdate() - 4, 112))
 
Still getting the time.

Thanks a bunch!!

-T
 
You mean you want the time completely gone? To do that in SQL Server <= 2005, you can't use a DATETIME datatype. You're going to have to convert to character data. If you are using Reporting Services, it's much easier to do this on the front end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top