Hello,
I have a query with calculates production for a machine in terms of
tonnes/hr. A use will input the starting engine hours, starting
tonnes, ending engine hours, and ending tonnes for each day. I have
an expression in a query which will subtract the starting and ending
hours/tonnes and then divide by one another. This works great unless
maintenance was being done on the machine and no production was
acheived. You then get 0/0 which produces the #Error message. I
posted this question once and someone told be to write this for my
expression:
Expr1: IIf(IsError(([TonneEnd]-[TonneStart])/([EngineEnd]-
[EngineStart])),0,([TonneEnd]-[TonneStart])/([EngineEnd]-
[EngineStart]))
However, I still get the #Error message. Is there something else I
should switch or should I somehow change the message. I would like it
to display zero if there is no production.
Thanks in advance,
John
Ken Snell (MVP) - 26 May 2007 03:10 GMT
Try this:
Expr1:
IIf(([EngineEnd]-[EngineStart])=0,0,(([TonneEnd]-[TonneStart])/([EngineEnd]-[EngineStart])))

Signature
Ken Snell
<MS ACCESS MVP>
> Hello,
>
[quoted text clipped - 19 lines]
>
> John
J. Trucking - 26 May 2007 05:30 GMT
On May 25, 8:10 pm, "Ken Snell \(MVP\)"
<kthsneisll...@ncoomcastt.renaetl> wrote:
> Try this:
>
[quoted text clipped - 31 lines]
>
> - Show quoted text -
Thanks Ken,
Worked great.