Skip to main content
Question

Trying to convert duration to number

  • June 7, 2020
  • 0 replies
  • 253 views

Hey All, 

Newbie here... I'm building an app for a non-profit that bills in Units.

1 Unit = 15 minutes

I have figured out how to calculate in minutes/hours as a duration based on Start Time/End Time. Here's my duration calculation:
ToTimeOfDay([End Time])-ToTimeOfDay([Start Time])

It yields: 15 minutes, 1 hour, 45 minutes, etc... as the answers. 
Now I need to translate it into Units. (Ex: 15 minutes = 1 Unit, 1 Hour = 4 Units, etc...). I know the first step is to convert the duration into a true number, but I keep getting errors. (See screen shot).

I've tried so many different ways, I'm getting myself confused what I've tried and haven't tried. Some errors are Formula Syntax and others are some type of Boolean depending on which settings I haves tried, another error I was getting was something like incompatible with duration. 

If someone can get me started on a path, that would be most helpful. 

Cheers, Mary



------------------------------
Mary Perkins
M3TR1CS Business Solutions
mary.perkins@m3tr1cs.com
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
No problem

ToMinutes(ToTimeOfDay([End Time])-ToTimeOfDay([Start Time]))

That will provide a response as a numeric value for the # of minutes.

If you have control over the data entry, it would be better to have the data entry fields be a time of day field type.  If they were that field type, then the formula would be.

ToMinutes([End Time] - [Start Time])
​

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------