Help

Combine days and hours into final date

2966 7
cancel
Showing results for 
Search instead for 
Did you mean: 
Tanguy_Auffret-
6 - Interface Innovator
6 - Interface Innovator

Hi,
I’ve searched the forum but didn’t find what I was looking for… but maybe I missed it. Sorry if that’s the case.
So I want to create the final date for an event.
I have a first set of functions that determine on which day it should happen and a second that determines at what time.
so in the end I have a field with a date (no time) and a field with hours/minutes.
I would like to create a new field combining both.
first I tried concatenate but it didn’t turn out well. then I tried using DateADD but the minutes were not recognized and converted as if they were decimals…
any idea on how to achieve that ?
thanks

7 Replies 7
Ptt_Pch
8 - Airtable Astronomer
8 - Airtable Astronomer

Could we have a little bit more info on your fields ? or a screenshot ? :winking_face:
How are your fields formatted ?

Depending on how those fields have been created and how they’re now structured, there might be different ways to get to the results you want :winking_face:

I agree. I think the main point is that there is not Time field type, so maybe you are using Duration or something.

Tanguy_Auffret-
6 - Interface Innovator
6 - Interface Innovator

Hi @Ptt_Pch & @Elias_Gomez_Sainz
here is a screenshot.
“début” is the date
“ordre” & “heure début 1” are variables
“heure C1” is the time calculated based on "ordre and “heure début c1”
“cour 1_final” is where I would like to combine “début” and “heure C1”.
hope that makes it a little clearer.
thanks !
combine.png

Lol, yes and no :yum:

I couldn’t reproduce your screenshot so I couldn’t really try and test before replying :winking_face:

But did you simply try this for your {Cour 1_final} field :

DATETIME_FORMAT({début},'M/D/YYYY')&'  '&{heure C1}

It’s kind of a simple concatenation of those 2 {début} and {heure C1}, as {heure C1} seems to return a “text”

Is that what you wanted ?

Hi @Ptt_Pch.
I tried your solution and indeed it provides the correct result as a text string ! Thanks.
But Airtable doesn’t recognize it as a valid date so I can’t display it in the calendar… and I need to be able to do that.
I found a workaround (not very user friendly) which is to express the time in minutes. That way I can perform a DATEADD({début},{heure C1},'minute')
in this scenario an event starting at 08:30 must be entered as starting at +510 minutes by the user… not very intuitive so if anyone has a better idea, I would be thankful !

You can use DATETIME_PARSE() that is the inverse of DATETIME_FORMAT(), it converts the resulting string into a Date.

Tanguy_Auffret-
6 - Interface Innovator
6 - Interface Innovator

IT works !!!
Thanks a lot !
:star_struck: :pray: :clap: