Is there something similar to DATEFROMPARTS(year, month, day) in SQL Server 2008? I want to create a date using the current year and month, but my own day of the mo
DATEFROMPARTS(year, month, day)
You could use something like this to make your own datetime:
DECLARE @year INT = 2012 DECLARE @month INT = 12 DECLARE @day INT = 25 SELECT CAST(CONVERT(VARCHAR, @year) + '-' + CONVERT(VARCHAR, @month) + '-' + CONVERT(VARCHAR, @day) AS DATETIME)