Skip to main content
Solved

Time difference formula between two single-select fields

  • June 4, 2024
  • 3 replies
  • 57 views

Forum|alt.badge.img+5

Hello,
I am trying to make the process of time tracking more user-friendly. Instead of using the duration field and writing manually each time record, I would like to use two single select fields as StartTime and EndTime pickers, each containing values 00:00, 00:15, 00:30, 15:30, 15:45, 16:00, etc.

But I am stuck with a formula that makes a magic difference between these two times.
Is it even possible with a formula, or does it need to be done with some sort of script?

Thank you 

Best answer by preshetin

Hi Peter - this can be done with a formula. It may look like this:

 

 
 
DATETIME_DIFF(
DATETIME_PARSE({End Date} ,'HH:mm'),
DATETIME_PARSE({Start Date},'HH:mm'),
'minutes')
 

 

Here is how it works in action:

 

3 replies

preshetin
Forum|alt.badge.img+5
  • Inspiring
  • Answer
  • June 4, 2024

Hi Peter - this can be done with a formula. It may look like this:

 

 
 
DATETIME_DIFF(
DATETIME_PARSE({End Date} ,'HH:mm'),
DATETIME_PARSE({Start Date},'HH:mm'),
'minutes')
 

 

Here is how it works in action:

 


Forum|alt.badge.img+5
  • Author
  • Participating Frequently
  • June 4, 2024

@preshetin Thank you!! Now it looks so simple 🙂


preshetin
Forum|alt.badge.img+5
  • Inspiring
  • June 4, 2024

@preshetin Thank you!! Now it looks so simple 🙂


Happy it worked for you @PeterJNCK  - in case you have additional questions feel free to send me a DM