March 2, 2021 at 12:26 am
It's been a while since I've messed with negative boolean algebra so I hope I got this right...
The first one equates to NOT (invoice_cl = 'INN1' OR PaymentStatus = 'Unpaid'). That means that anything with an 'IIN1' will be excluded and anything with an 'Unpaid' in the rows will be excluded whether or not it's an 'IIN1' row or not.
The second one states that both 'INN1' AND 'UnPaid' must be in the same row and, if they are, only then exclude it.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 2, 2021 at 12:41 am
not (invoice_cl in('INN1') and [Payment Status] = 'Unpaid')
= (invoice_cl not in('INN1') or [Payment Status] <> 'Unpaid')
= (invoice_cl <> 'INN1' or [Payment Status] <> 'Unpaid')so the statement
[Invoice Class] IN (@invoice) and not (invoice_cl in('INN1') and [Payment Status] = 'Unpaid')is equivalent to
[Invoice Class] IN (@invoice) and (invoice_cl <> 'INN1' or [Payment Status] <> 'Unpaid')
So in your first statement you have an AND where you should have an OR
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply