SQL Server allows you to build dates and times from "parts"—i.e., from partial information. These function are very useful if you have only integers indicating part of a date or time and you would like to get the full date or time.
DATEFROMPARTS() function generates a date from integers given as arguments. It looks like this:
DATEFROMPARTS(year, month, day)
The three arguments are integers representing the year, month (from 1 to 12), and day. The arguments are always in the year-month-day order. If you write:
DATEFROMPARTS(2018, 7, 5);
it will return the date