Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

#Error in Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J. Trucking - 26 May 2007 03:07 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.