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)
CREATE FUNCTION DATEFROMPARTS ( @year int, @month int, @day int ) RETURNS datetime AS BEGIN declare @d datetime select @d = CAST(CONVERT(VARCHAR, @year) + '-' + CONVERT(VARCHAR, @month) + '-' + CONVERT(VARCHAR, @day) AS DATETIME) RETURN @d END GO