Calculating Time Error?????

M

mattsmom

I am using the following code in a text box on a report.

=Sum(DateDiff("m",[Ti2ndDive],[To2ndDive]))\60 & ":" &
Format(Sum(DateDiff("n",[Ti1stDive],[To1stDive])) Mod 60,"00")

The [Ti2ndDive] is 10:40, the [To2ndDive] is 11:20. My calculations say 40
minutes, Access calculations say "0:56". Is this correct or did I leave a
conversion step off???

Please help, I've been working on this error since 6:30 am!!!

Thanks in advance!
 
J

John Spencer

I can't decide what you are trying to do. But you used M (months) in the
first Sum and not N. and then you useed Ti1stDive and TO1stDive in the second
part of the expression instead of Ti2ndDive and To2ndDive

Sum(DateDiff("n",[Ti2ndDive],[To2ndDive]))\60 & ":" &
Format(Sum(DateDiff("n",[Ti1stDive],[To1stDive])) Mod 60,"00")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
F

fatima santos

mattsmom said:
I am using the following code in a text box on a report.

=Sum(DateDiff("m",[Ti2ndDive],[To2ndDive]))\60 & ":" &
Format(Sum(DateDiff("n",[Ti1stDive],[To1stDive])) Mod 60,"00")

The [Ti2ndDive] is 10:40, the [To2ndDive] is 11:20. My calculations say
40
minutes, Access calculations say "0:56". Is this correct or did I leave a
conversion step off???

Please help, I've been working on this error since 6:30 am!!!

Thanks in advance!
 
M

mattsmom

John,
Thank you... I should listen to all of your advice and copy and past formula
rather than trying to re-type.... thanks!

John Spencer said:
I can't decide what you are trying to do. But you used M (months) in the
first Sum and not N. and then you useed Ti1stDive and TO1stDive in the second
part of the expression instead of Ti2ndDive and To2ndDive

Sum(DateDiff("n",[Ti2ndDive],[To2ndDive]))\60 & ":" &
Format(Sum(DateDiff("n",[Ti1stDive],[To1stDive])) Mod 60,"00")


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I am using the following code in a text box on a report.

=Sum(DateDiff("m",[Ti2ndDive],[To2ndDive]))\60 & ":" &
Format(Sum(DateDiff("n",[Ti1stDive],[To1stDive])) Mod 60,"00")

The [Ti2ndDive] is 10:40, the [To2ndDive] is 11:20. My calculations say 40
minutes, Access calculations say "0:56". Is this correct or did I leave a
conversion step off???

Please help, I've been working on this error since 6:30 am!!!

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top