Overflow error (1 Viewer)

Infinite

More left to learn.
Local time
Today, 09:04
Joined
Mar 16, 2015
Messages
402
Code:
Work: IIf([RT ID]="Amazon",IIf([RT Fulfillment Channel]="Amazon",0,[RT Gross Sales]+[RT Shipping Cost Received]/[RT Quantity]*0.15*[RT Quantity]),0)


I am trying to get that to work, but I am getting an Overflow error. No idea why. Does anyone have any idea why? Thanks!
 

boerbende

Ben
Local time
Today, 18:04
Joined
Feb 10, 2013
Messages
339
overflow means that the result is outside the specification of your variable. for example you have 8 bits (=256 max) but you result = 300. so what is work?
try to analyze the variables seperately.
By the way:
you divide by [RT quantity] and then multiply again. without brackets. So effect = 1

Ben
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:04
Joined
Aug 30, 2003
Messages
36,125
You can also get that error if dividing by zero. Is that quantity field ever zero...or Null? And did you mean to include it twice?
 

Ranman256

Well-known member
Local time
Today, 12:04
Joined
Apr 9, 2015
Messages
4,337
You can't put a super large number in a variable defined as integer.
It must be LONG.
 

Infinite

More left to learn.
Local time
Today, 09:04
Joined
Mar 16, 2015
Messages
402
You can also get that error if dividing by zero. Is that quantity field ever zero...or Null? And did you mean to include it twice?


That was the problem. There was about 15 records that had 0. After changing/deleting them it now works. Was about to smash my computer after the 10,000th time if seeing the Overflow error.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:04
Joined
Aug 30, 2003
Messages
36,125
Happy to help.
 

Users who are viewing this thread

Top Bottom