Session Ready
Exercise

Convert imported data to dates with time zones

Now that we have seen the three type-safe conversion functions, we can begin to apply them against real data sets. In this scenario, we will parse data from the dbo.ImportedTime table. We used a different application to load data from this table and looked at it in a prior exercise. This time, we will retrieve data for all rows, not just the ones the importing application marked as valid.

Instructions
100 XP
  • Fill in the missing TRY_XXX() function name inside the EventDates common table expression.
  • Convert the EventDateOffset event dates to 'UTC'. Call this output EventDateUTC.
  • Convert the EventDateOffset event dates to 'US Eastern Standard Time' using AT TIME ZONE. Call this output EventDateUSEast.