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