Thread: Access 2010 division by 0 error
2014-02-18, 06:09 #1
- Join Date
- Oct 2013
- Thanked 0 Times in 0 Posts
Access 2010 division by 0 error
Hi, I have got a div by 0 problem which I've tried to get round by using an IIf statement with no luck. It's in an aggregate query grid, the formula is in "expression" mode and is:
I've tried Iif (([b3]=0,"",...... but no luck.
Can anyone tell me what I'm doing wrong? Thanks so much
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2014-02-18, 10:23 #2
- Join Date
- Aug 2001
- Evergreen, CO, USA
- Thanked 41 Times in 41 Posts
First, is this in a query or behind a form or report? Since you are attempting to use the Immediate If function, I will presume it is in a query. In that case, the syntax should be something like Sum([I3] * IIF(Nz([B3],0)=0,0,[DirectHours]/[B3])) - note that is untested aircode - but the idea is to deal not only with the 0 case, but also with the case where [B3] is null. That uses the Nz() function to return a 0 if it is null.Wendell