I am using CONVERT(data_type(length),expression,style) function to change the format of a date in a SELECT query.
CONVERT(data_type(length),expression,style)
Declare @dt nvarchar(20)>
I Think this is the best way to do it.
REPLACE(CONVERT(NVARCHAR,CAST(WeekEnding AS DATETIME), 106), ' ', '-')
Because you do not have to use varchar(11) or varchar(10) that can make problem in future.
varchar(11)
varchar(10)