C
cyrus05 via AccessMonster.com
hi
How can I calculate sum of repeated values. Tables are (contracts,
Jobsin_contracts,Contract_detail).
A bit of the problem is I have a contracts, jobs_in_contract outer join with
contract_id and contract_detail table outer join with (contract_id, Job_Id).
Stock_ID is entered for every job_id. thus making it possible that same
stock_ID can be entered for more than once with different quanities for each
job in that contract, but while it comes to invoicing, I want to show the
total of the stock_ID quantity given to that particular contract.
I hope I could explain my problem, can anyone please tell me how to calculate
the sum of the repeating items seperately grouped by job_ID?
Below is example of the data
Contract Table
Contract ID
1
Jobs_in_contract
Contract_ID Job_ID
1 1
1 2
Contract_Detail
Contract_ID Job_ID Stock_ID Quantity
1 1 001 10
1 1 002 4
1 2 001 5
Until this point my application works perfactly, but now I want to create an
invoice for the contract NO 1 where it should be as follow
Contract_ID Stock_ID Quantity
1 001 15
1 002 4
Can any one please help me how to calculate the sum of the repeating values
in queries based on the above example.
How can I calculate sum of repeated values. Tables are (contracts,
Jobsin_contracts,Contract_detail).
A bit of the problem is I have a contracts, jobs_in_contract outer join with
contract_id and contract_detail table outer join with (contract_id, Job_Id).
Stock_ID is entered for every job_id. thus making it possible that same
stock_ID can be entered for more than once with different quanities for each
job in that contract, but while it comes to invoicing, I want to show the
total of the stock_ID quantity given to that particular contract.
I hope I could explain my problem, can anyone please tell me how to calculate
the sum of the repeating items seperately grouped by job_ID?
Below is example of the data
Contract Table
Contract ID
1
Jobs_in_contract
Contract_ID Job_ID
1 1
1 2
Contract_Detail
Contract_ID Job_ID Stock_ID Quantity
1 1 001 10
1 1 002 4
1 2 001 5
Until this point my application works perfactly, but now I want to create an
invoice for the contract NO 1 where it should be as follow
Contract_ID Stock_ID Quantity
1 001 15
1 002 4
Can any one please help me how to calculate the sum of the repeating values
in queries based on the above example.