Change Hour + Decimal to Hour + Min

  • Thread starter Thread starter chopper57 via AccessMonster.com
  • Start date Start date
C

chopper57 via AccessMonster.com

I have to log a start time and finish time for pipe tests and there mostly
done at night and logging time as PM and AM.
I use a Medium Time format for the start and finish times in the table and on
the report.
The fields are called: TestCompleted and TestStart

The report has a field called Duration and the control source:
=IIf([TestCompleted]>[TestStart],([TestCompleted]-[TestStart])*24,24-(
[TestStart]-[TestCompleted])*24)

Example:
TestStart 09:30 PM
TestCompleted 11:40 PM
Duration: 2.1666667 (Hour + Decimal)

I would like the Duration Result show 2:10 (Hour + Min)
 
Try:

=IIf([TestCompleted]>[TestStart],Format([TestCompleted]-[TestStart]),
"hh:nn"),Format(24-([TestStart]-[TestCompleted], "hh:nn"))

This will, of course, fail if the difference is more than 24 hours.
 

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

Back
Top