T-SQL Tutorial

T-SQL TimeFromParts Date Function


TIMEFROMPARTS is an date function and returns a time value for the specified time and with the specified precision.

TimeFromParts Syntax:

TIMEFROMPARTS( hour, minute, seconds, fractions, precision )

TimeFromParts Example:

SELECT TIMEFROMPARTS ( 16, 47, 56, 7, 1 ) as Time_1,
TIMEFROMPARTS ( 14, 47, 56, 70, 2 ) as Time_2,
TIMEFROMPARTS ( 14, 47, 56, 700, 3 ) as Time_3;

Time_1Time_2Time_3
16:47:56.714:47:56.7014:47:56.700