Results 1 to 3 of 3

Thread: Division Error

  1. #1
    Join Date
    May 2004
    Posts
    3

    Unanswered: Division Error

    I have a calculated field in a query that divides [Net Aging] by [ADR]. However in some instances 1 or both of those fields will contain zero which results in an #Error coming up. What type of error handling would I do to just show 0 as a result if this occurs. Thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313
    This should do it:

    IIF([Net Aging]=0 OR [ADR] =0, 0, [Net Aging]/[ADR])

    HTH,

    Chris

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by cpgospi
    This should do it:

    IIF([Net Aging]=0 OR [ADR] =0, 0, [Net Aging]/[ADR])

    HTH,

    Chris
    Actually all you need to eliminate the error is:


    IIF([ADR]=0, 0, [Net Aging]/[ADR])
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •