[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.
[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.
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.
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.
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!