Jump to content
Sign in to follow this  
Henry Olive

SQL Integer Overflow

Recommended Posts

Interbase,

SELECT IM.ITEMNO,

SUM(Case When IM.TNAME = 'Sell' then IM.QTY * (IM.UPRICE * IM.CURRRATE) else 0 end)

FROM ITEMMOVEMENTS IM

GROUP BY IM.ITEMNO

I get Integer Overflow error msg.

 

I Tried

SUM(Case When IM.TNAME = 'Sell' then CAST(IM.QTY * (IM.UPRICE * IM.CURRRATE) AS NUMERIC(18,2)) else 0 end)

I again get Integer Overflow error msg.

 

I also tried

 CAST(SUM(Case When IM.TNAME = 'Sell' then IM.QTY * (IM.UPRICE * IM.CURRRATE) else 0 end)  AS NUMERIC(18,2))

I again get Integer Overflow error msg.

 

Any suggestion ?
Thank You

 

Share this post


Link to post
Guest

Break it out with samples,

 

select (mYConundrum)

from rdb$database

 

Put different values/operations/operands into MyConundrum to figure out a fool-proof case statement.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×