Results 1 to 4 of 4
  1. #1
    RunTime91 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    281

    How to handle a divided by zero in access calculated field

    Greetings All



    I'm trying to create an expression in an Access calculated field to reflect 0.00% when either of the two fields included in the function are zero

    My current attempt is as follows:
    Code:
    IIf(Or([PluggedIn] = 0, [SignedInTime] =0),0,([PluggedIn]/[SignedInTime]))
    As I'm sure you can ascertain - my two fields are: PluggedIn & SignedInTime

    I have also tried IfError / IsError & Nz

    Thank You so much for any help

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That looks like Excel OR syntax. More like

    ([PluggedIn] = 0 Or [SignedInTime] =0)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RunTime91 is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    281
    Hey Paul ~

    Yes, that is exactly what that is - lol - I was getting desparate and all I could find on Google had to do with Linked Tables

    Thanks for the liferaft - Paul

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    LOL! Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-24-2017, 06:39 PM
  2. Replies: 4
    Last Post: 11-07-2016, 04:43 PM
  3. Field that can handle addition
    By albzn in forum Forms
    Replies: 15
    Last Post: 10-06-2015, 01:35 PM
  4. In access form sum of calculated field
    By pgdeval in forum Access
    Replies: 1
    Last Post: 10-27-2014, 02:07 AM
  5. Replies: 2
    Last Post: 06-02-2013, 08:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums