1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: #ERROR in Access

Discussion in 'Business Applications' started by benhur1978, May 6, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. benhur1978

    benhur1978 Thread Starter

    Joined:
    Jan 23, 2007
    Messages:
    33
    I am creating a query with various fields in, one of which is an expression - (Round(([Actual - Issued]/[At Branch])*100,2) - this gives me the %age of issued products at a branch level.

    If, in the branch field in the source data there is a 0 (zero) the expression comes back with #Error, is the an addition I can add to the expression to put a 0 (zero) in the output.

    If I was using Excel I would use =IF(ISERROR(F4/G4),0,F4/G4)

    I have tried IIf(IsError(Round(([Actual - Issued]/[At Branch])*100,2)),0,(Round(([Actual - Issued]/[At Branch])*100,2))), but it still comes back with #Error in the output file.

    Thanks in advance for your help.

    Ben
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    How about using the IIf to check for the Branch being a 0 and enter a zero, instead of trying to trap an error that has already happened.
     
  3. benhur1978

    benhur1978 Thread Starter

    Joined:
    Jan 23, 2007
    Messages:
    33
    Now by using - IIf([AT Branch]=0,0,(Round(([Actual - Issued]/[At Branch])*100,2))) it works well

    Thanks OBP
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Great
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/921409

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice