I find that if I don't round the Summed values in the below query, I get a random number with a long decimal value for values that should be 0. When I round it as shown below, this solves the issue. It only affects zero (0) values. Any idea what's going on?!
SELECT     
    AccNo, AccType, ROUND(SUM(amount), 4) AS balance
FROM
    TRANS_Table
WHERE     
    (comp = 'XXX') AND (transdate <= @AsAtDate)
GROUP BY 
    AccNo, AccType
ORDER BY 
    AccNo
Thanks
 
    