Access duration calculation

Kath

Registered User.
Local time
Today, 12:04
Joined
Nov 26, 2011
Messages
24
Hi!
I'm new here; hoping someone else has run into this and can help. I'm calculating durations; recently added

=Format(Int([text48]/60) & ":" & [text48] Mod 60,"Short Time")
to 'Issue Duration' Control Source

where text48 is the calculation: =((([Issue Ended]-[Issue Started])*24)*60)

which resolved the '24 hr clock' issue I was having when ie: 'Issue Started' is 23:30 and 'Issue Ended' is 01:00.

Now I'm seeing that anytime 'Issue Ended' and 'Issue Started' have the same number of seconds; the duration is off by 1 hr; it's 1 hr less than should be. I'm at a loss and am not knowledgeable with code (hope there's a simple answer!!!):confused:

And thanks in advance to anyone who tries to help
 
there must be an intrinsic truncation taking place within your int function, i expect. i would investigate that
eg 4hrs - 1 hrs 10mins = 2 hrs 50 mins, and int just returns the 2, rather than round to 3.

cint() will round, but it all depends exactly what you want to happen.
 
Thanks, I think I'm in over my head. I've run 3 weeks worth of durations and no other calculations are invalid - - only when the seconds are the same number in both the start and end times. And it's always one hr less. I think I KNOW I'm in over my head !!

I don't round anything, it all comes out exact hrs and minutes. And all correct; unless the seconds are the same....i'm still googling/searching - maybe the int truncating something is what's going on. I'm clueless.
 
Oh my. I changed INT to FIX, that didn't work, but when I changed it to 'ROUND' the calculations seem fine - do you see any ramifications of doing that? And again, thanks for your help; your 'INT may be truncating' gave me different wording to search for...
 

Users who are viewing this thread

Back
Top Bottom