Concatenate String + date in SQL Server

Viewed 29571

I have the following data:

KEY        ID         DATE
123456789  09BA2038   01-01-2017

And I would like to concatenate it, but keep the original format of the date. When I try:

CONCAT(Key, '-', ID, '-', DATE) 

it gives me an output of

123456789-09BA2038-Jan 01 2017 11:00AM

But I would like the output to be

123456789-09BA2038-01-01-2017
5 Answers
Related