Subject Weird Integer Overflow
Author James
Hi when I execute this sql query

select (("TotalAmount" * (1-("Discount"*0.01)) * (1-("Discount2"*0.01))
* (1-("Discount3"*0.01)) - "Less" - "Adjustment")) as "GrandTotal"
from "invoice"

Iam getting a Interger Overflow error. The result of an integer
operation cause the most significant bit of the result to carry. But I
don't have any integer field here ... All of them are Numerics(15,2)
expcept for the discounts field which are numerics(4,2)

1. I limit the number of records to be included with "where
"TotalAmount" < 100000" and everything works well. I have a
"TotalAmount" = 560000 as the biggest value.

2. I have try this sql and it works on all records

select "TotalAmount"* (1-("Discount"*0.01)) * (1-("Discount2"*0.01))
from "invoice"


select "TotalAmount"* (1-("Discount2"*0.01)) * (1-("Discount3"*0.01))
from "invoice"

What is this error? :-(