- Local time
- Today, 18:29
- Joined
- Feb 28, 2001
- Messages
- 27,001
The first select query runs to get the Sales analysis. We get the result, Sales of Widgets, £10000. The VAT content is saved in the same records, £2000
Another invoice is added.
The second query runs to get the VAT. Now we have £11000 of sales and £2200 of VAT saved in the table.
We get VAT £2200 returned
Another invoice is added.
The third query runs to get the debtors, by summing the net and VAT values. Now we have £12000 of sales and £2400 of VAT saved in the table.
We get £14400 returned as debtors total.
Either I'm being especially dense, or you are describing something that cannot happen as you describe it. Those are SELECT queries according to your explanation. It is insanely difficult verging on flat-out impossible for a SELECT query to update a table (or as you say, "saved in the same records."). You need an INSERT INTO or UPDATE query to do that, yet you persist in calling these SELECT queries.
I think further clarification is required as to this process. If I have missed something, I deeply apologize, but I just can't make a mental image of whatever is going on here. Without that image, I'm kind of lost.