Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Getting time difference
- This topic has 10 replies, 3 voices, and was last updated 5 years, 3 months ago by john cesta.
-
AuthorPosts
-
August 27, 2019 at 7:44 PM #36550
john cestaParticipantHow do I calculate endTime-startTime in hours and minutes
August 27, 2019 at 8:13 PM #36552
Sam MoffattParticipantTry out the attached in a calc field. I really wish copy and paste worked better on the Mac for calc fields.
HOURS
gives you the difference between two fields in hours with fractional overflow. So we get the hours value first, get theFLOOR
value 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
HOURS
again 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 theFLOOR
of it to remove the fractional values again.Attachments:
You must be logged in to view attached files.August 27, 2019 at 9:49 PM #36563
BrendanKeymasterAn 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:MM
and Tap Forms will display the result as a duration in hours and minutes. There are other ways to format the duration too, such ashrs, mins
orHH:MM:SS
, etc.August 28, 2019 at 12:21 AM #36566
Sam MoffattParticipantThat’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
john cestaParticipantThanks 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
BrendanKeymasterHi John,
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
john cestaParticipantPerhaps it’s because my start and end time are
DateTime fields.
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
Sam MoffattParticipantI 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).Attachments:
You must be logged in to view attached files.August 29, 2019 at 8:43 PM #36606
john cestaParticipantBut does the summary calculation work?
August 29, 2019 at 10:49 PM #36608
Sam MoffattParticipantSeems to unless I’m looking at the wrong item.
Attachments:
You must be logged in to view attached files.August 30, 2019 at 6:14 AM #36627
john cestaParticipantHuh, 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.
-
AuthorPosts
You must be logged in to reply to this topic.