Sunday, February 14, 2010

DATEADD

Do you remember DATEADD and DATEDIFF functions?
What does the following statement do?

SELECT DATEADD(DD, 0, DATEDIFF(DD, 0, GETDATE()))

A. Return the current system date unchanged.
B. Return just the date part of the current system date removing the time.
C. Return the integer value of the current system date.
D. The statement will generate an error. The second parameter of the DATEDIFF function should be a DATETIME data type.

Answer:[B]
Highlight to find out the answer.

No comments:

Post a Comment