Session Ready
Exercise

Seconds or no seconds?

In the video, you saw how DATEDIFF() can be used to calculate the trip time by finding the difference between Start and End time, but how do you know the dataset includes seconds in the transactions?

Here, you'll use DATEPART() to see how many transactions have seconds greater than zero and how many have them equal to zero. Then you can evaluate if this is an appropriate amount. The CASE statement will segregate the dataset into two categories.

Instructions
100 XP
  • Complete the first CASE statement, using DATEPART() to evaluate the SECOND date part of StartDate.
  • Complete the second CASE statement in the GROUP BY the same way.