Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I have a report with the fol

Status
Not open for further replies.

proximity

Technical User
Sep 19, 2002
132
GB
Hi,

I have a report with the following calculation:

=[ClockIn]-[ClockOut]

The result of this is displayed in the format hh:mm.

Now, if someone clocks in at 21:30 and clocks out at 07:00, it will not display the actual elapsed time in a sensible manner! Instead of 9.30 hours, I get 15.15 hours!!!! I presume it's because the time period is effectively spread over two days.

Anyhelp greatly appreciated!

Thanks,

--
Steven
 
Isn't your expression:
=[ClockOut]-[ClockIn]
Try something like:
=IIf(ClockOut<ClockIn,ClockOut+(1-ClockIn),ClockOut-ClockIn)

Duane
MS Access MVP
 
Hi Duane,

Thanks for the solution, but I get the following message when trying it: invalid. (dot)!operator or invalid parenthesis

I've tried what I can, but no luck :(
 
I don't think there is anything wrong with this expression. Do you get an error viewing the datasheet of the report's record source?

If this expression is causing the error, paste your expression in a reply.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top