DATETIME2FROMPARTS

Returns a datetime2 value for the specified date and time and with the specified precision.

Syntax

DATETIME2FROMPARTS ( year, month, day, hour, minute, seconds, fractions, precision )

Arguments

year

Integer expression specifying a year.

month

Integer expression specifying a month.

day

Integer expression specifying a day.

hour

Integer expression specifying hours.

minute

Integer expression specifying minutes.

seconds

Integer expression specifying seconds.

fractions

Integer expression specifying fractions.

precision

Integer literal specifying the precision of the datetime2 value to be returned.

Return types

datetime2( _precision_ )

Example

SELECT DATETIME2FROMPARTS(2011,8,15,14,23,44,500,3);

See Also