Which of the following statement is correct for DATEDIFF function in SQL?
Which of the following statement is correct for DATEDIFF function in SQL?
I. This function reports difference between the arguments ‘startdate’ and ‘enddate’.
II. In this, ‘datepart’ argument/value can be specified in a variable.
Show answerHide answer
Correct answer: (A) Only I
Explanation
DATEDIFF returns the difference between startdate and enddate in the given datepart, so I is correct. The datepart cannot be supplied through a user-defined variable or quoted string, so II is wrong.