Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    [scrap pcs]/IIf([good pcs]+[scrap pcs]=0, 1, [good pcs]+[scrap pcs])



    Is there possibility either of these fields could be Null? Arithmetic with Null returns Null.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'll get out of the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    NewbyForAccess is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2015
    Posts
    49
    Neither of the fields will ever be null. They at least have a 0 entered. I tried your expression and it's working exactly how I need it to. I always include production that contains both 0 good pieces and 0 scrap pieces for tracking purposes or this issue wouldn't have reared its ugly head. Wow, Access is harder to learn than Excel and all those formulas! I was trying the IIf function at the beginning of the expression and that's where I went wrong. And, I'm unsure of using the 1 in the formula. I was using a 0 where you have the 1. Could you explain it so I'll at least understand this completely? Sometimes I think I make it harder than it is, and I'm finding that out from all the help I've found here in this forum. You all make it look so simple. June and Paul, thanks so much for all your help. Without it, I might have ended up bald.

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Providing 1 as alternate value means the expression will never divide by 0. Any number other than 0 would serve the purpose.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    NewbyForAccess is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2015
    Posts
    49
    Great, thanks for explaining it. I've used this in other reports already and it's working for all of them including those that I have Sums of the fields. I can't thank you enough!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report Sorting and Grouping
    By singleton2330 in forum Database Design
    Replies: 4
    Last Post: 10-16-2014, 11:07 AM
  2. Report Sorting
    By B30 in forum Reports
    Replies: 1
    Last Post: 10-07-2014, 12:28 PM
  3. Sorting a report
    By tylerg11 in forum Reports
    Replies: 1
    Last Post: 12-14-2012, 03:25 PM
  4. Sorting numbers on a report
    By paul123 in forum Access
    Replies: 6
    Last Post: 02-15-2012, 03:34 PM
  5. Incorrect sorting in report.
    By jonesy29847 in forum Reports
    Replies: 2
    Last Post: 06-16-2010, 05:56 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