SQLTeam.com | Weblogs | Forums

Convert Date

I have a date in a field on a table 20170101 and need to convert it to 2017-01-01. What is the easiest way to do this?

The field is not a date field

Thanks

STUFF(STUFF(date_column, 7, 0, '-'), 5, 0, '-')

Thanks Scott