Please help with time calculations

G

Guest

I need to create a form that accept data entry in the following fashion:

Start End Duration
00:00 00:45 0.75
00:45 01:30 0.75

Start and End times must be in 24hr format. My problem is in the duration. I
am required to calculate the duration like the example above i.e. instead of
showing it as 0:45 min (00:00 (12:00 AM) – 00:45 (12:45 AM) = 0:45 minutes,
my client requires it to show as three quarters of an hour in decimal format
(0.75). how can I do that? I need the user to enter 00:00 and 00:45 then the
form will calculate the 0.75.
Thanks
Al
 
M

Marshall Barton

A slightly simpler equivalent ;-)

=datediff("n",[Start],[End]) / 60

Or, to avoid a lot of decimals:

=Format(datediff("n",[Start],[End]) / 60, "0.00")
--
Marsh
MVP [MS Access]

=1/(60/datediff("n",[Start],[End]))


Al said:
I need to create a form that accept data entry in the following fashion:

Start End Duration
00:00 00:45 0.75
00:45 01:30 0.75

Start and End times must be in 24hr format. My problem is in the duration. I
am required to calculate the duration like the example above i.e. instead of
showing it as 0:45 min (00:00 (12:00 AM) – 00:45 (12:45 AM) = 0:45 minutes,
my client requires it to show as three quarters of an hour in decimal format
(0.75). how can I do that? I need the user to enter 00:00 and 00:45 then the
form will calculate the 0.75.
 
G

Guest

Thanks, I had a feeling that there should be something more simple, but i
couldn't put my fingure on it.
Thanks

Marshall Barton said:
A slightly simpler equivalent ;-)

=datediff("n",[Start],[End]) / 60

Or, to avoid a lot of decimals:

=Format(datediff("n",[Start],[End]) / 60, "0.00")
--
Marsh
MVP [MS Access]

=1/(60/datediff("n",[Start],[End]))


Al said:
I need to create a form that accept data entry in the following fashion:

Start End Duration
00:00 00:45 0.75
00:45 01:30 0.75

Start and End times must be in 24hr format. My problem is in the duration. I
am required to calculate the duration like the example above i.e. instead of
showing it as 0:45 min (00:00 (12:00 AM) – 00:45 (12:45 AM) = 0:45 minutes,
my client requires it to show as three quarters of an hour in decimal format
(0.75). how can I do that? I need the user to enter 00:00 and 00:45 then the
form will calculate the 0.75.
 

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