Complete the code to calculate the number of days between Order Date and Ship Date.
DATEDIFF('day', [Order Date], [1])
DATEDIFF calculates the difference between two dates. Here, we want days between Order Date and Ship Date, so Ship Date is the second argument.
Complete the code to add 3 months to the Order Date.
DATEADD('month', [1], [Order Date])
DATEADD adds a specified number of intervals to a date. To add 3 months, use 3 as the second argument.
Fix the error in the code to calculate the number of weeks between two dates.
DATEDIFF([1], [Start Date], [End Date])The interval argument in DATEDIFF must be a string in single quotes, like 'week'.
Fill both blanks to calculate the date 10 days before the Ship Date.
DATEADD([1], [2], [Ship Date])
To subtract days, use 'day' as the interval and a negative number for days to subtract.
Fill all three blanks to calculate the number of months between Order Date and Ship Date, then add 2 months to the Order Date.
DATEDIFF([1], [Order Date], [Ship Date]) + DATEADD([2], [3], [Order Date])
Use 'month' as interval for DATEDIFF and DATEADD. Add 2 months by using 2 as the number.