G
Guest
I have three tables, Entries, Jobs and Parts. These three tables are related
with one-to-many relationships, from left to right.
i.e. one entry - many jobs
one job - many parts
Among the other fields, in the parts table there is quantity and price, and
in the jobs table labour. Additionally, I created a 3-level report where I
calculated, using a calculated field, the total of each job using the
expression:
=[Labour]+Sum([Quantity]*[Price Sold])
Now, I want to create another calculated field to sum up all the job totals
for each entry. I tried using the expression
=Sum([Labour])+Sum([Quantity]*[Price Sold]), but the outcome is wrong.
Specifically, there is a problem with the first part of the expression
(sum([labour]). Instead of summing up all the labour fields that exist in the
jobs table, it acts as if labour is a field of the parts table instead.
ie.
If I have 2 jobs with labours 20 and 10 and each job has two and three parts
respectively, the calculation performed with =sum([labour]) expression is:
(20+20)+(10+10+10) = 70 instead of 20+10=30
Any idea how to make the calculation I want (count each labour once and add
it to the total cost of the parts)?
with one-to-many relationships, from left to right.
i.e. one entry - many jobs
one job - many parts
Among the other fields, in the parts table there is quantity and price, and
in the jobs table labour. Additionally, I created a 3-level report where I
calculated, using a calculated field, the total of each job using the
expression:
=[Labour]+Sum([Quantity]*[Price Sold])
Now, I want to create another calculated field to sum up all the job totals
for each entry. I tried using the expression
=Sum([Labour])+Sum([Quantity]*[Price Sold]), but the outcome is wrong.
Specifically, there is a problem with the first part of the expression
(sum([labour]). Instead of summing up all the labour fields that exist in the
jobs table, it acts as if labour is a field of the parts table instead.
ie.
If I have 2 jobs with labours 20 and 10 and each job has two and three parts
respectively, the calculation performed with =sum([labour]) expression is:
(20+20)+(10+10+10) = 70 instead of 20+10=30
Any idea how to make the calculation I want (count each labour once and add
it to the total cost of the parts)?