Counting the number of days between dates
In this exercise, you will calculate the difference between the order date and ship date.
This exercise is part of the course
Intermediate SQL Server
Exercise instructions
Write a query that returns the number of days between OrderDate
and ShipDate
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Return the difference in OrderDate and ShipDate
SELECT OrderDate, ShipDate,
___(___, OrderDate, ShipDate) AS Duration
FROM Shipments