Yesterday we discussed about time function, today we are going to see DATEFROMPARTS function which is new in SQL Server Denali. It will return a date value for the specified year, month and day. All the arguments should be valid else error is thrown, if you have NULL value in argument then NULL is returned.
Syntax is below
DATEFROMPARTS ( year, month, day )
Lets try with an example
SELECT DATEFROMPARTS(2011,09,02)
Leave a Reply