FOR Example if I have:
DECLARE @Day int = 25 DECLARE @Month int = 10 DECLARE @Year int = 2016
I want to return
2016-10-2
In SQL Server 2012+, you can use datefromparts():
datefromparts()
select datefromparts(@year, @month, @day)
In earlier versions, you can cast a string. Here is one method:
select cast(cast(@year*10000 + @month*100 + @day as varchar(255)) as date)