dv8123456789
New member
- Local time
- Today, 13:27
- Joined
- Oct 10, 2017
- Messages
- 8
Hi - I have a system I have inherited, which after about of year of no problems has a query that is now resulting in an overflow error that I cannot get to the bottom of. The problem seems to stem from an expression field...
% Load: Round(IIf(Sum(IIf([Data Type]="Capacity",[DataValue],0))>0,(Sum(IIf([Data Type]="Demand",[DataValue],0))/(Sum(IIf([Data Type]="Capacity",[DataValue],0))-Sum(IIf([Data Type]="Holiday",[DataValue],0))))),4)
I have tried to do a little research into why this might be and from what I have found it could be something to do with divide by zero, but interestingly the query runs and I don't get divide by zero error. Its only when I sort the field or try and use the result set in another query that I get the error. It looks as if my predecessor has tried to accommodate for zeros by using IIF's?? Any help would be much appreciated. Thanks
% Load: Round(IIf(Sum(IIf([Data Type]="Capacity",[DataValue],0))>0,(Sum(IIf([Data Type]="Demand",[DataValue],0))/(Sum(IIf([Data Type]="Capacity",[DataValue],0))-Sum(IIf([Data Type]="Holiday",[DataValue],0))))),4)
I have tried to do a little research into why this might be and from what I have found it could be something to do with divide by zero, but interestingly the query runs and I don't get divide by zero error. Its only when I sort the field or try and use the result set in another query that I get the error. It looks as if my predecessor has tried to accommodate for zeros by using IIF's?? Any help would be much appreciated. Thanks