Sep 15, 2023 08:08 AM
Hi folks,
I'm have a dataset of events in Airtable with each event as a row, and each row has a different number of sessions that can make up the complete event. This means I have 8 end date & time columns to capture the finish time of each session. I need a column that will dynamically show the end date & time of the whole event, regardless of the number of sessions so that I can use this in various calendar/timeline views in Airtable.
I've attempted to pull them all into an IF statement, like this:
Solved! Go to Solution.
Sep 15, 2023 08:13 AM - edited Sep 15, 2023 08:16 AM
The DATETIME_FORMAT() function outputs a text representation of your date – so if you want Airtable to interpret your output as a date, simply remove the DATETIME_FORMAT() function! The fields you reference are already dates so they don't need to be specially formatted. You can change the display format by going into the settings for that field.
That being said, to address your original question, if you need to convert a date string to a date object that Airtable understands, use DATETIME_PARSE().
Sep 15, 2023 08:13 AM - edited Sep 15, 2023 08:16 AM
The DATETIME_FORMAT() function outputs a text representation of your date – so if you want Airtable to interpret your output as a date, simply remove the DATETIME_FORMAT() function! The fields you reference are already dates so they don't need to be specially formatted. You can change the display format by going into the settings for that field.
That being said, to address your original question, if you need to convert a date string to a date object that Airtable understands, use DATETIME_PARSE().
Sep 15, 2023 09:41 AM
Also, @Data_things, I would highly recommend restructuring your database. Instead of creating 8 redundant date fields for sessions, I would create an entirely new table for sessions and link each event to its sessions. Then, you could easily use rollup fields to get the first and last session. You also gain much more flexibility in many other ways as well.