/*Basic script to take a series of integer values and convert them into a date*/
DECLARE @day tinyint = 31
DECLARE @month tinyint = 12
DECLARE @year smallint = 2017
SELECT CAST(CAST(@year AS varchar) + '-' + CAST(@month AS varchar) + '-' + CAST(@day AS varchar) AS DATETIME)