Link to home
Start Free TrialLog in
Avatar of mucicid
mucicidFlag for Indonesia

asked on

Interbase / FIrebird Error on SUM()

i got error likethis when im trying to sum an ammount on sales

Arithmetic exception, numeric overflow, or string truncation
Statement: select sum(sales) from tkt_tiket where sdate >= '2009-01-01' and sdate <= '2009-01-31'

Can anybody help for this error
Avatar of Geert G
Geert G
Flag of Belgium image

the number sum(sales) may be too big

possible a very big number got into the system causing the overflow
find it like this:

select max(sales) from tkt_tiket where sdate >= '2009-01-01' and sdate <= '2009-01-31'

or

select sales
from tkt_tiket
where sdate >= '2009-01-01' and sdate <= '2009-01-31'
order by sales desc
do you get this same error if you do it from the ib console ?

or just in delphi ?
Avatar of mucicid

ASKER

i got the error from ib console and sql explorer. im using C# for the app i havent tried on delphi, on C# app it works well.
have you checked the values in the db for sales ?
What type is sdate field?
ASKER CERTIFIED SOLUTION
Avatar of Nick Upson
Nick Upson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mucicid

ASKER

thx. sory for too long