A subscriptions dataset has an [Order Date] field stored as a date. Finance wants a calculated field [Renewal Due] that returns the date exactly three months after each order, so a contract placed on 10 April returns 10 July. Which calculation returns the correct renewal date?
Option A: DATEADD('month', 3, [Order Date])
Option B: DATEDIFF('month', [Order Date], 3)
Option C: DATEADD('day', 3, [Order Date])
Option D: DATEADD('quarter', 3, [Order Date])- ADATEADD('month', 3, [Order Date]) Correct
- BDATEDIFF('month', [Order Date], 3)
- CDATEADD('day', 3, [Order Date])
- DDATEADD('quarter', 3, [Order Date])
Why A is correct: DATEADD shifts a date by an interval; with the date_part 'month' and an increment of 3 it returns the date three calendar months later, so 10 April becomes 10 July.
Why B is wrong: This is tempting because it also names 'month', but DATEDIFF measures the number of intervals between two dates and returns an integer, not a date, and 3 is not even a valid date argument.
Why C is wrong: DATEADD is the right function, but the date_part 'day' advances the order by only three days rather than the three calendar months the renewal rule requires.
Why D is wrong: DATEADD is the right function, but 'quarter' with an increment of 3 advances the date by nine months rather than the three months required.