Categories
General

DATEFROMPARTS function – SQL Server Denali

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)

datefromparts

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*