Tag Archives: date from parts in sql server 2012

What is DATEFROMPARTS Function in SQL Server?

DATEFROMPARTS Function was introduced with SQL Server 2012. This function is used to get date value from year, month and day values.
Syntax:
DATEFROMPARTS(Year,Month,Day)
Example:

Declare @Year int = 2015
Declare @Month int = 6
Declare @Day int = 9
Select DATEFROMPARTS(@Year,@Month,@Day)


Result:
2015-06-09