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

TSQL DATE FORMATING 1

Status
Not open for further replies.

pyttviper

MIS
May 15, 2001
37
US
I want to Format a date to return YYYY-MM-DD with out the hours minutes or seconds. i have looked through all of the help text and cannot find an appropriate way to format a date.

HELP!!!!!!


dan0
 
just use convert and limit the output to varchar(10) like:
select convert(varchar(10),getdate(),20)
 
i know this looks silly but it lets me compare data in the table where that data's date ar 00.00.00.000 formated

thanks for the help

convert(datetime, convert(varchar(10),getdate(),20),20)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top