I have a query that has an inner join. everything works fine except I'm trying to subtract two fields to get a remaining balance. both fields are int.
what is happening is the value will not zero out if it's supposed to be a 0
e.g.
so the sum of RECEIVED = 4074 and the sum of TRANSFERED = 4074 the remaining amout is showing 4074 and not 0
what causes this and how can I fix it ?
any help would be appreciated
thanks
Code:
SUM(MY_TABLE.TRANSFERED) AS TRANSFERED
,SUM(MY_TABLE.RECEIVED - MY_TABLE.TRANSFERED) AS REMAINING
what is happening is the value will not zero out if it's supposed to be a 0
e.g.
so the sum of RECEIVED = 4074 and the sum of TRANSFERED = 4074 the remaining amout is showing 4074 and not 0
what causes this and how can I fix it ?
any help would be appreciated
thanks