Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Getting time difference
August 27, 2019 at 7:44 PM #36550
How do I calculate endTime-startTime in hours and minutesAugust 27, 2019 at 8:13 PM #36552
Try out the attached in a calc field. I really wish copy and paste worked better on the Mac for calc fields.
HOURSgives you the difference between two fields in hours with fractional overflow. So we get the hours value first, get the
FLOORvalue for it and print that out.
The next step is to get rid of the whole numbers and have only the fractional value, so we use
HOURSagain with the floor and take it away from the actual value then we multiply that by 60 to get it to minutes and then get the
FLOORof it to remove the fractional values again.August 27, 2019 at 9:49 PM #36563
An alternative approach would be to create a formula like:
[End Date] - [Start Date]
The result will be the number of seconds between the start date and the end date.
Then set the Number Format property on the Calculation field to
HH:MMand Tap Forms will display the result as a duration in hours and minutes. There are other ways to format the duration too, such as
HH:MM:SS, etc.August 28, 2019 at 12:21 AM #36566
That’s a much more elegant approach, I figured there had to be a better way after I wrote it all up.August 29, 2019 at 5:02 AM #36585
Thanks to you both.
I tried to get a total of the meeting time using a calculation summary but it displays a large negative number. Is there a way to add these meeting times?
Trying to getting a total summary of meeting times by using a weekly filter.August 29, 2019 at 12:06 PM #36592
When you set the Number Format to HH:MM on your Calculation field (assuming you’re returning a Number value), then when you set the Calculation Summary option to Total on your Calculation field, Tap Forms will display the results properly in HH:MM format.
Not sure why you’re getting negative numbers unless your formula has the subtraction backwards.August 29, 2019 at 7:44 PM #36601
Perhaps it’s because my start and end time are
While the calculation per record works the summary doesn’t.
When I make two new start and end times specifically as time fields it works and the summary as well.August 29, 2019 at 8:08 PM #36603
I have date time fields and it works ok for me. Here’s a quick screenshot of the settings.
Time Diff Easy is
[End] - [Start]set to number format with the number formatted as Time (HH:MM).August 29, 2019 at 8:43 PM #36606
But does the summary calculation work?August 29, 2019 at 10:49 PM #36608
Seems to unless I’m looking at the wrong item.August 30, 2019 at 6:14 AM #36627
Huh, I’ll set up another isolated test. I’m on iPad mini.
When I tried that I received a big negative number. But let me try it again.
I changed my production form to a separate date and time for meeting start and end.
You must be logged in to reply to this topic.