SQL Server Convertir la cadena hasta la fecha
select Cast( '2021-09-22' as date ) as castedDate;
select convert(date,'20210922') as convertedDate;
MzanziLegend
select Cast( '2021-09-22' as date ) as castedDate;
select convert(date,'20210922') as convertedDate;
SELECT CONVERT(VARCHAR, GETDATE(),101) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),102) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),103) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),104) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),105) AS DATE
SELECT CONVERT(VARCHAR, GETDATE(),106) AS DATE
SELECT DATE = FORMAT(GETDATE(), 'dd-MM-yyyy')
SELECT FORMAT(dbo.column, 'M/dd/yyyy')