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)>
Try this:
Declare @dt NVARCHAR(20) Select @dt = REPLACE(CONVERT(CHAR(15), SalesDate, 106),' ',' - ') FROM SalesTable