OK, let's break down the query that didn't work:
Code:
select begin_bal ,bal, final_bal
from testing
where ((begin_bal <> .00) and (bal <> .00) and (final_bal <> .00))
order by fund,acct
This will only return the records that have a balance, a beginning balance and a final balance. If you wanted to find one that had a value in any one of those fields, you would replace the ands with ors
Code:
select begin_bal ,bal, final_bal
from testing
where (begin_bal <> .00 or bal <> .00 or final_bal <> .00)
order by fund,acct
or you could re-write it as you had with the NOT operator
Code:
select *
from testing
where not(begin_bal = .00 and bal = .00 and final_bal = .00)
order by fund,acct
The reason your last one worked is like Rudy said. If any one of the conditions inside the not is false, it's going to pass that check.
Bookmarks