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


Posted

in

by

Comments

One response to “DATEFROMPARTS function – SQL Server Denali”

  1. SQL-Articles » DATEFROMPARTS function – SQL Server Denali…

    Thank you for submitting this cool story – Trackback from DotNetShoutout…

Leave a Reply

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