mucicid
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
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
do you get this same error if you do it from the ib console ?
or just in delphi ?
or just in delphi ?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx. sory for too long
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