hello guys I have a simple query but it just dosent seem to work. I have a column that I like to only add when another column is between a range, but i keeping getting "0" even though some part of the range does contain values. can someone please point out the obvious.
Thanks in advance
select nvl(sum(fgbopal_14_ytd_actv),0) from fgbopal
where fgbopal_fund_code = '400002'
and nvl((fgbopal_acct_code),0) between '7000' and '7019'
and nvl((fgbopal_acct_code),0) between '7046' and '7177'
FYI If part of the range has a value but the other part does not, I still get a "0".
Help!