Instruction
Great! There are many other functions that you can use to achieve similar result. Take a look at the comparison below:
DATEFROMPARTS(year, month, day)—allows you to create a date. Its arguments are self-explanatory.TIMEFROMPARTS(hour, minute, second, fraction, precision)—the first three arguments are self-explanatory. The fraction sets the value to a fraction of second, while precision sets the number of digits in the precision of the fraction.SMALLDATETIMEFROMPARTS(year, month, day, hour, minute)—creates a date time of typeSMALLDATETIME. It does not handle seconds and fractions of a second; however, it sets the seconds to 0. This behaviour cannot be changed.DATETIMEFROMPARTS(year, month, day, hour, minute, second, millisecond)—creates a date time of typeDATETIME. The arguments are self-explanatory. The millisecond argument sets the number of milliseconds (i.e., a fraction with precision set to 3).
Exercise
Click to continue.



