Session Ready
Exercise

Multi statement TVF

Create a multi statement table value function that returns the trip count and average ride duration for each day for the month & year parameter values passed.

Instructions
100 XP
  • Create a function CountTripAvgDuration() that returns a table variable named @DailyTripStats.
  • Declare input parameters @Month and @Year.
  • Insert the query results into the @DailyTripStats table variable.
  • Use CAST to select and group by StartDate as a date data type.