Share via

When sorting get error message Division by zero

Anonymous
2011-08-25T13:13:36+00:00

I have made a query to make new column in my Access database with the following fomula: FSC: Round([ex am1]/[on bill],3)

An example of the ending result of one is (EX AM1=00021500)   /  (on bill=464400)  The Result in this new column is FSC= 0.046.

I want to sort the new FSC Column from Z-A Decending and it gives me the Error message: Division by zero---Is their a way to fix something so I can sort this column?

Thanks

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2011-08-25T18:38:29+00:00

You might try uploading a zip file containing the database.

I thought that the expression I posted in my first reply would have taken care of 0 values. Does the following work better?

FSC: IIf(Nz([on bill],0)=0, 0, Round([ex am1]/[on bill],3))

Was this answer helpful?

0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-08-25T16:05:16+00:00

    I have a windows live acct, but not sure how to do it

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points
    2011-08-25T15:05:22+00:00

    Could you make a stripped down copy of the database (without sensitive information) available through a site that lets you upload and share files such as Windows Live SkyDrive, then post a link here?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-08-25T14:47:25+00:00

    I copied your suggestion and ran the query and the FSC Colum reads "#Error"

    Any other suggestions

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points
    2011-08-25T14:28:07+00:00

    Try

    FSC: IIf([on bill]=0, Null, Round([ex am1]/[on bill],3))

    Was this answer helpful?

    0 comments No comments