Hello,
I've been searching for 2 days for a solution but didn't find anything, please help me with this small DSUM formula.
I have 3 tables (1st: PurchaseInvoicesT, 2nd: CustomsT) (where I ship goods from 1 country to another, and I can't put them in 1 table because there are 2 different suppliers and so many details in each table
Relationship between these 2 tables is PurchaseID
Here are some fields that matter in my question
1st: PurchaseID, TotalAmount
2nd: CustomsID, PurchaseID, TotalAmount, Notes (Including Customs there is VAT which is in the same invoice but I need to separate it, So I mentioned VAT in Notes in specific Rows)
Lets say I have only 2 Purchase Id's 101 & 102
I'm trying to make a Query to show me PurchaseID (Only 2 Rows 101 & 102), TotalAmount (for each Order), VATAmount (VAT: DSum("Total","CustomsT","Notes='VAT'"))
Here is the main problem
VAT: DSum("Total","CustomsT","Notes='VAT'") This works fine, but it gets me the sum of VAT of all orders
So I need something like that, to get the sum of VAT of each order
VAT: DSum("Total","CustomsT","Notes='VAT'" And [CustomsT]![PurchaseID]=[PurchaseInvoicesT]![PurchaseID])
I've searched and searched and tried a million different ways to write this and nothing works.
Could anyone tell me how to write this DSUM function?
I've been searching for 2 days for a solution but didn't find anything, please help me with this small DSUM formula.
I have 3 tables (1st: PurchaseInvoicesT, 2nd: CustomsT) (where I ship goods from 1 country to another, and I can't put them in 1 table because there are 2 different suppliers and so many details in each table
Relationship between these 2 tables is PurchaseID
Here are some fields that matter in my question
1st: PurchaseID, TotalAmount
2nd: CustomsID, PurchaseID, TotalAmount, Notes (Including Customs there is VAT which is in the same invoice but I need to separate it, So I mentioned VAT in Notes in specific Rows)
Lets say I have only 2 Purchase Id's 101 & 102
I'm trying to make a Query to show me PurchaseID (Only 2 Rows 101 & 102), TotalAmount (for each Order), VATAmount (VAT: DSum("Total","CustomsT","Notes='VAT'"))
Here is the main problem
VAT: DSum("Total","CustomsT","Notes='VAT'") This works fine, but it gets me the sum of VAT of all orders
So I need something like that, to get the sum of VAT of each order
VAT: DSum("Total","CustomsT","Notes='VAT'" And [CustomsT]![PurchaseID]=[PurchaseInvoicesT]![PurchaseID])
I've searched and searched and tried a million different ways to write this and nothing works.
Could anyone tell me how to write this DSUM function?