Subject | Numeric Overflow Error |
---|---|
Author | Zoran Zivkovic |
Post date | 2007-03-24T10:15:09Z |
Hi All,
My query lokes like this:
SELECT
V_TXT1,
sum(I_KOL) AS KOMADA,
Sum(I_CENA*I_KOL*(1-(F_KASP/100.00))*((100-I_RAB)/100)) AS VP
FROM GLAVNI_UPIT
WHERE (I_DAT>=:POC AND I_DAT<=:KRAJ)
GROUP BY V_TXT1
ORDER by 2 DESC
Fields I_CENA, I_KOL, F_KASP, I_RAB are by definition of types
NUMERIC(15,2). If I take to wide range for dates parameters in WHERE
clausule, I receive error. "arithmetic exception, numeric overflow,
or string truncation". Maximal value which I get for one of results
for column VP is "9209924.62677999958" - for dates between 1.1.2007-
9.3.2007. If I change second date to 10.3.2007, I receive error
mentioned above. I would apreciate help from someone how to resolve
this. I use FB 2.0, I tried all decimal datatypes (NUMERIC, DECIMAL,
FLOAT, DOUBLEPRECISION) as datatype for result - column VP - no
solution.
Regards
Zile
My query lokes like this:
SELECT
V_TXT1,
sum(I_KOL) AS KOMADA,
Sum(I_CENA*I_KOL*(1-(F_KASP/100.00))*((100-I_RAB)/100)) AS VP
FROM GLAVNI_UPIT
WHERE (I_DAT>=:POC AND I_DAT<=:KRAJ)
GROUP BY V_TXT1
ORDER by 2 DESC
Fields I_CENA, I_KOL, F_KASP, I_RAB are by definition of types
NUMERIC(15,2). If I take to wide range for dates parameters in WHERE
clausule, I receive error. "arithmetic exception, numeric overflow,
or string truncation". Maximal value which I get for one of results
for column VP is "9209924.62677999958" - for dates between 1.1.2007-
9.3.2007. If I change second date to 10.3.2007, I receive error
mentioned above. I would apreciate help from someone how to resolve
this. I use FB 2.0, I tried all decimal datatypes (NUMERIC, DECIMAL,
FLOAT, DOUBLEPRECISION) as datatype for result - column VP - no
solution.
Regards
Zile