strangeryet
Programmer
The query I have works up to a point, perhaps I need another to get the results I want, but I can't seem to get it to work.
The first query: Groups by Roll Size, Plant Site and KiloPrice.
SELECT rolltable.rollsize, Count(rolltable.rollnum) AS [Count], rolltable.rcvrplant, rolltable.kiloprice, Sum(rolltable.kgswgt) AS SumKilos, Format([SumKilos]*[Kiloprice],"Currency") AS TotalValue
FROM rolltable
WHERE (((rolltable.useddate) Is Null))
GROUP BY rolltable.rollsize, rolltable.rcvrplant, rolltable.kiloprice
HAVING (((rolltable.rcvrplant)=[@Site]));
This produces a result like:
rollsize count rcvrplant kiloprice SumKilos TotalValue
34.9 10 1 0.62 2826 $1,752.12
63.5 24 1 0.525 12035 $6,318.37
63.5 22 1 0.6035 11915 $7,190.70
63.5 125 1 0.62 68439 $42,432.18
69.9 20 1 0.62 11235 $6,965.70
Now I need a query that will Sum the 'SumKilos' and the TotalValue.
For a result like:
Count rcvrplant (Sum of sumofkilos) (sum of TotalValue)
201 1 106450 $64,659.07
(I hope spacing is in this post is maintained)
Thanks
The first query: Groups by Roll Size, Plant Site and KiloPrice.
SELECT rolltable.rollsize, Count(rolltable.rollnum) AS [Count], rolltable.rcvrplant, rolltable.kiloprice, Sum(rolltable.kgswgt) AS SumKilos, Format([SumKilos]*[Kiloprice],"Currency") AS TotalValue
FROM rolltable
WHERE (((rolltable.useddate) Is Null))
GROUP BY rolltable.rollsize, rolltable.rcvrplant, rolltable.kiloprice
HAVING (((rolltable.rcvrplant)=[@Site]));
This produces a result like:
rollsize count rcvrplant kiloprice SumKilos TotalValue
34.9 10 1 0.62 2826 $1,752.12
63.5 24 1 0.525 12035 $6,318.37
63.5 22 1 0.6035 11915 $7,190.70
63.5 125 1 0.62 68439 $42,432.18
69.9 20 1 0.62 11235 $6,965.70
Now I need a query that will Sum the 'SumKilos' and the TotalValue.
For a result like:
Count rcvrplant (Sum of sumofkilos) (sum of TotalValue)
201 1 106450 $64,659.07
(I hope spacing is in this post is maintained)
Thanks