🎴 Flashcard Mode

Excel Functions and VBA Programming

Card1 / 19
Mastered0
Review0
QuestionClick to flip

Find the function that returns the difference between two dates in terms of month.

AnswerClick to flip back
A
datediff(mm,'01/01/2010',getdate())
💡 Explanation:

The DATEDIFF function in SQL Server calculates the difference between two dates. Syntax is DATEDIFF(interval, start_date, end_date). To get month difference, use 'mm' or 'mon' as the interval. Option D is correct: DATEDIFF(mm, '01/01/2010', GETDATE()) calculates the month difference between the two dates. DATEADD adds intervals, and there's no DATESUB function.

Change Mode