I have the following query:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item No[/TD]
[TD]Item Class[/TD]
[TD]Dept Code[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]0004[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]5[/TD]
[TD]175[/TD]
[/TR]
</tbody>[/TABLE]
I want to add another column showing what percentage of each item's total consumption is related to the department:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item No[/TD]
[TD]Item Class[/TD]
[TD]Dept Code[/TD]
[TD]Quantity[/TD]
[TD]Item Total[/TD]
[TD]% of Quantity[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]50[/TD]
[TD]80[/TD]
[TD]62.5%[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]30[/TD]
[TD]80[/TD]
[TD]37.5%[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]90
[/TD]
[TD]90[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]75[/TD]
[TD]195[/TD]
[TD]38.5%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]100[/TD]
[TD]195[/TD]
[TD]51.3%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]195[/TD]
[TD]10.3%[/TD]
[/TR]
[TR]
[TD]0004[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[TD]275[/TD]
[TD]36.4%[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]5[/TD]
[TD]175[/TD]
[TD]275[/TD]
[TD]65.6%[/TD]
[/TR]
</tbody>[/TABLE]
I've tried the below text, but I get a syntax error
Item Total: (Select Sum(Quantity)
FROM [Consumption by Item & Dept] AS [Total Consumption by Item]
WHERE [Total Consumption by Item].[Item No] = [Consumption by Item & Dept].[Item No])
I am very new to access and have tried to correct this a few ways, but don't know what I'm doing wrong.
Thanks!
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item No[/TD]
[TD]Item Class[/TD]
[TD]Dept Code[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]0004[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]5[/TD]
[TD]175[/TD]
[/TR]
</tbody>[/TABLE]
I want to add another column showing what percentage of each item's total consumption is related to the department:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item No[/TD]
[TD]Item Class[/TD]
[TD]Dept Code[/TD]
[TD]Quantity[/TD]
[TD]Item Total[/TD]
[TD]% of Quantity[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]50[/TD]
[TD]80[/TD]
[TD]62.5%[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]30[/TD]
[TD]80[/TD]
[TD]37.5%[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]90
[/TD]
[TD]90[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]1[/TD]
[TD]75[/TD]
[TD]195[/TD]
[TD]38.5%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]2[/TD]
[TD]100[/TD]
[TD]195[/TD]
[TD]51.3%[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]Raw Material[/TD]
[TD]3[/TD]
[TD]20[/TD]
[TD]195[/TD]
[TD]10.3%[/TD]
[/TR]
[TR]
[TD]0004[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]4[/TD]
[TD]100[/TD]
[TD]275[/TD]
[TD]36.4%[/TD]
[/TR]
[TR]
[TD]0005[/TD]
[TD]WIP Item[/TD]
[TD]5[/TD]
[TD]175[/TD]
[TD]275[/TD]
[TD]65.6%[/TD]
[/TR]
</tbody>[/TABLE]
I've tried the below text, but I get a syntax error
Item Total: (Select Sum(Quantity)
FROM [Consumption by Item & Dept] AS [Total Consumption by Item]
WHERE [Total Consumption by Item].[Item No] = [Consumption by Item & Dept].[Item No])
I am very new to access and have tried to correct this a few ways, but don't know what I'm doing wrong.
Thanks!