February 19th, 2003, 05:00 AM
Join Date: Feb 2003
Location: Canada - Egypt
Time spent in forums: < 1 sec
Reputation Power: 11
I hope I didn't mis-understand what you ment.
but if you want a query that would report improper values of total amount then:
In ACCESS this should work
a query like this should give you the results you want
WHERE TAmount <> (
(Select sum( Price )
Where [Item].ID = [in].ID)
(Select sum (TAx)
Where [Tax].ID = [in].ID)
Table IN -- Fields ID, TAmout
Table TAx -- Fields ID, TaxAmount
Table Item -- Fields ID, Price
where x is the ID of the invoice you want to validate.
The IDs returned are for invoices that do not pass the validation.
The syntax might be a little different in other DB platforms.
Note: I have only tested this using very small data sets .. so it might not be 100% effecient, please make sure you test more.
Last edited by yassoor : February 19th, 2003 at 05:09 AM.