Results 1 to 2 of 2
  1. #1
    ia2mn is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    1

    Query expresion not working using IIF(IsError

    I am building an expresion to simply take the number from one field in the query and divide it by another number in the query. However some of the corresponding numbers in the 2nd field are 0 so I will get a #Error in return. I thought I'd beat this by using IIF(IsError but when I do, I still am getting an #Error return and its only the issues that would correspond to a Div/0 error. Here is the expression please tell me what you think.



    Expr1: IIf(IsError([CurrentMonth]/[PreviousMonth]),"0",[CurrentMonth]/[PreviousMonth])

    Thank You

  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,521
    I would test for PreviousMonth being 0.
    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. Run Query Button Not Working
    By SusanHRO in forum Forms
    Replies: 8
    Last Post: 08-15-2011, 10:33 AM
  2. IIf(IsError ... problem ...
    By jacek.w.bak in forum Forms
    Replies: 1
    Last Post: 07-07-2011, 11:08 AM
  3. parameter query not working
    By denny in forum Access
    Replies: 3
    Last Post: 02-20-2011, 01:07 PM
  4. IIf Update Query working OK but a better way?
    By dreamweaver547 in forum Queries
    Replies: 7
    Last Post: 04-19-2010, 09:47 AM
  5. Query is not working
    By pushpm in forum Programming
    Replies: 3
    Last Post: 04-14-2009, 07:16 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