Please Help on Acces Querries

yahia

New Member
Joined
Jan 16, 2010
Messages
2
Hello Everyone
I am new her . I have a mdb that contains many tables like:

Customers. that includes the fields: CusID, CusName ...
Invoice.that includes the fields: InvoiceNo, CusID, Amount...
Incomingmoney:that includes the fields: IncomID, CusID, IncomingAmount...
Shippedcontianers that includes the fields: ShipId, CusID, ShipFeeAmount...


All these tables are linked by a field called CusID
i wanna to make a query that additionate the amounts of invoices(Amount) + shippedcontainers (ShipFeeAmount) moins - incomingmoney(IncomingAmount). this result is the balance of the customer
but when i did it by making a simple queries that includes this fields from these tables, every customers has to have a recod in every tables to be shown in the BALANCE query
in other word if a customer has somes invoices but he has no record in the table Shippedcontianers or nver make TT that allow him to have a record in Incomingmoney the query did not make a balance for him
I wanna to find i way to calculate the balance of every customers even if he has not record in every tables
I hope that i got understood
Please help me i am in need
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello Everyone
I am new her . I have a mdb that contains many tables like:

Customers. that includes the fields: CusID, CusName ...
Invoice.that includes the fields: InvoiceNo, CusID, Amount...
Incomingmoney:that includes the fields: IncomID, CusID, IncomingAmount...
Shippedcontianers that includes the fields: ShipId, CusID, ShipFeeAmount...


All these tables are linked by a field called CusID
i wanna to make a query that additionate the amounts of invoices(Amount) + shippedcontainers (ShipFeeAmount) moins - incomingmoney(IncomingAmount). this result is the balance of the customer
but when i did it by making a simple queries that includes this fields from these tables, every customers has to have a recod in every tables to be shown in the BALANCE query
in other word if a customer has somes invoices but he has no record in the table Shippedcontianers or nver make TT that allow him to have a record in Incomingmoney the query did not make a balance for him
I wanna to find i way to calculate the balance of every customers even if he has not record in every tables
I hope that i got understood
Please help me i am in need

Please post your query sql.
 
Upvote 0
thank u for ur reply
my query has the following

SELECT Customers.CusID, Customers.Name, Sum(Incomingmoney.IncomingAmount) AS IncomingAmountOfSum, Sum(Invoice.Amount) AS AmountOfSum, Sum(Shippedcontianers.ShipFeeAmount) AS ShipFeeAmountOfSum, ([AmountOfSum]+[ShipFeeAmountOfSum])-[IncomingAmountOfSum] AS CusBalance
FROM ((Customers INNER JOIN Incomingmoney ON Customers.CusID = Incomingmoney.CusID) INNER JOIN Invoice ON Customers.CusID = Invoice.CusID) INNER JOIN Shippedcontianers ON Customers.CusID = Shippedcontianers.CusID
GROUP BY Customers.CusID, Customers.Name;


I have for exemple 3 customers a, b, c
in the table of invoice there is only 3 records means three invoices two of them for customer a and one is for customer c
no record then for b so the query did not retun any thingabout abour customers b but he had incomingmoney and shipped containers and i need the quert to show all to be able to calculate his balance
query.jpg
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top