When did you check in?
Not only can you convert strings to datetime values, you can also manipulate these values themselves. Your manager has tasked you with further breaking down the date and time that gym members visit a certain location. Time to get to it!
This exercise is part of the course
Data Types and Functions in Snowflake
Exercise instructions
- Update this query to cast the
checkin_time
column to aDATE
stored in a column calledthe_date
. - Add a final line to the
SELECT
statement to castcheckin_time
to aTIME
data type and alias the resulting column asthe_time
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
SELECT
checkin_time,
-- Cast checkin_time to DATE
___::___ AS the_date,
-- Cast checkin_time to TIME
___::___ AS the_time
FROM CORE_GYM.visits
;