Originally Posted by
Ajax
Sorry, I must be dense.
In addition to you taking 11 posts to provide the full sql and previously providing sql which was not your actual sql causing the problem
I've explained why your subquery doesn't work - no response <-- no reply necessary as it does not provide the solution to exclude invoices with no registration, etc ...
I've provided the correction - no response <-- I responded and stated I don't know what correction is as whatever it is I am not seeing a solution to exclude invoices with no registration, etc ...
I've provided a more efficient (i.e. faster performance) construction of your query - no response <-- again, nothing to will exclude invoices with no registration, etc ...
I've asked for clarification of your latest variation - and regret the explanation does not make sense <-- sorry it does not make sense. I thought it was quite simple. To exclude all invoices when there is no registration line but has an ADMINFEE and/or SHIPPING line.
As illustrated, an invoice may have 1 to many lines. Of which in this case there are possibility of up to 3 lines:
Once again:
1. Registration and it's amount line item - sometimes there may not be a registration line item
2. ADMINFEE and it's amount line item - sometimes there may not be a shipping line item
3. SHIPPING and it's amount line item - sometimes there may not be a shipping line item
There can be any combination of the above.
Looking for code to exclude invoices where it does not have a registration line item but has an ADMINFEE and/or SHIPPING line items.
WHEN it ONLY has ADMINFEE and /or SHIPPING AND WITHOUT Registration
If it only has adminfee or shipping records, it can't have a registration - so what am I missing <-- correct, so this type of invoice without a Registration should be excluded.
I'm not going to spend my time trying to understand this latest variation until you have to courtesy to respond to the points above and explained why they don't work and why they are not a solution and for the last point explain what I am missing