How to Format date and datetime in Sql Server?
I typically shorten datetime to date via this format:
SELECT convert(varchar, getdate(), 102) – yyyy.mm.dd – 2008.10.02
or this
SELECT convert(varchar, getdate(), 112) – yyyymmdd
Here are some additional good reference sites for this:
http://www.sql-server-helper.com/tips/date-formats.aspx
http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/