See Books Online topic CONVERT for available display styles for DATETIME datatypes. Internally the date is stored like it is stored, we only ever see a display format.
For example, to see a date displayed like yyyymmdd
Code:
SELECT CONVERT(CHAR(8), importantDate, 112) FROM etc.
Or, to see yyyy-mm-dd
Code:
SELECT SUBSTRING(CONVERT(VARCHAR(20), importantDate, 120), 1, 10) FROM etc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.