I'm assuming your field names represent account balances? I think you may want to rething how you are storing your data. Looks like you may have a problem with repeating groups as columns.
But if you must do it this way then you would have to run a series of OR statements to get what you want.
SELECT *
FROM tablename
WHERE Bal1 < 0 Or Bal< 0...etc
This is very inefficient.
I'd create an item table and balance table and link them by an item id or something.
I agree on the inefficency but I 'inherited' this database and was asked to write a 'quick' report for someone. I do need to rewrite/change several things in this database but do not have the time right now since this table is already used in many queries. I was just lookng for a quick way to select the info for the report.
I did not completely discribe my problem. It gets more complicated as I need to change the filter based on the supplier. Sometimes I need to only select records if a negative accurs in the first 13, next time it might be 18.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.