convert date format sql yyyy-mm-dd code example
Example 1: SQL query to convert DD/MM/YYYY to YYYY-MM-DD
SELECT CONVERT(varchar(10), CONVERT(date, '13/12/2016', 103), 120)
Example 2: sql server convert string to date
Cast( '2011-07-07' as date ) as convertedDate
Example 3: sql convert date to string yyyy-mm-dd
select CONVERT(char(10), GetDate(),126)
/* 2020-12-23 */