Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Interbase / FIrebird Error on SUM()

Posted on 2010-09-09
7
754 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:mucicid
7 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33634225
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
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33634231
do you get this same error if you do it from the ib console ?

or just in delphi ?
0
 

Author Comment

by:mucicid
ID: 33634427
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.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 33634677
have you checked the values in the db for sales ?
0
 
LVL 4

Expert Comment

by:bjove
ID: 33637139
What type is sdate field?
0
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 33644446
Please try this and see if it solves the problem

select sum(sales) from tkt_tiket where sdate >= '2009-01-01' and sdate <= '2009-01-31' and sales is not null
0
 

Author Closing Comment

by:mucicid
ID: 34016960
thx. sory for too long
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question