How to format a date in SQL Server 2008
SELECT CONVERT(CHAR(10), GetDate(), 126)
Using CHAR (10), this will chop off some of the time you don't need.
ps. Replace GetDate () with the date you need to convert
EDIT: Cast and Convert "shows this conversion.
a source to share
If you have a real "datetime" column, the date is not stored in any particular string format, but in (fixed) binary format.
Only when displaying the results in Query Analyzer (or Management Studio) is the internal format converted to a string. If you ask for this column, you will return a real date (not a string).
a source to share
You said you stored the value in string format, so first you need to convert it back to a date using the convert (date, columnname, 103) command, then you can format it as you like .
An example of choosing a format (convert (date, "29 -03-2019", 103), "yyyy-mm-dd")
it converts a date string in the format dd-mm-yyyy to a date string yyyy-mm-dd.
a source to share