C
Craig
Hi,
I have a union query which brings together Process/Quality Costs, the
problem im having is that i need the first "Start Cost" to come through into
the second part of the query, so i can apply that cost to the second process
- for a total. this needs to go on for 5 to 6 processes.
Any ideas?
Regars
Craig
''Process1"
SELECT QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100)
AS StartCost, QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead] AS TotCost,
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
FROM Quality INNER JOIN (Process INNER JOIN (QryRawProcessSumed INNER JOIN
ProcessQuality ON (QryRawProcessSumed.ProcessID = ProcessQuality.ProcessID)
AND (QryRawProcessSumed.QualityCode = ProcessQuality.QualityCode)) ON
Process.ProcessID = ProcessQuality.ProcessID) ON Quality.QualityCode =
ProcessQuality.QualityCode
GROUP BY QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100),
QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead],
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
HAVING (QryRawProcessSumed.ProcessID)=6
UNION
''Process 2"
SELECT QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100)
AS StartCost, QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead] AS TotCost,
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
FROM Quality INNER JOIN (Process INNER JOIN (QryRawProcessSumed INNER JOIN
ProcessQuality ON (QryRawProcessSumed.ProcessID = ProcessQuality.ProcessID)
AND (QryRawProcessSumed.QualityCode = ProcessQuality.QualityCode)) ON
Process.ProcessID = ProcessQuality.ProcessID) ON Quality.QualityCode =
ProcessQuality.QualityCode
GROUP BY QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100),
QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead],
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
HAVING (QryRawProcessSumed.ProcessID)=3
I have a union query which brings together Process/Quality Costs, the
problem im having is that i need the first "Start Cost" to come through into
the second part of the query, so i can apply that cost to the second process
- for a total. this needs to go on for 5 to 6 processes.
Any ideas?
Regars
Craig
''Process1"
SELECT QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100)
AS StartCost, QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead] AS TotCost,
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
FROM Quality INNER JOIN (Process INNER JOIN (QryRawProcessSumed INNER JOIN
ProcessQuality ON (QryRawProcessSumed.ProcessID = ProcessQuality.ProcessID)
AND (QryRawProcessSumed.QualityCode = ProcessQuality.QualityCode)) ON
Process.ProcessID = ProcessQuality.ProcessID) ON Quality.QualityCode =
ProcessQuality.QualityCode
GROUP BY QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100),
QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead],
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
HAVING (QryRawProcessSumed.ProcessID)=6
UNION
''Process 2"
SELECT QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100)
AS StartCost, QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead] AS TotCost,
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
FROM Quality INNER JOIN (Process INNER JOIN (QryRawProcessSumed INNER JOIN
ProcessQuality ON (QryRawProcessSumed.ProcessID = ProcessQuality.ProcessID)
AND (QryRawProcessSumed.QualityCode = ProcessQuality.QualityCode)) ON
Process.ProcessID = ProcessQuality.ProcessID) ON Quality.QualityCode =
ProcessQuality.QualityCode
GROUP BY QryRawProcessSumed.ProcessID, QryRawProcessSumed.QualityCode,
ProcessQuality.Labour, ProcessQuality.VarOverHead,
ProcessQuality.FixedOverHead, ProcessQuality.ProcessWaste,
([SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead])*([ProcessInput/Output])*(1+[NextProcessWaste]/100),
QryRawProcessSumed.SumOfRawWasteMatCost,
[SumOfRawWasteMatCost]+[Labour]+[VarOverHead]+[FixedOverHead],
Process.[ProcessInput/Output], ProcessQuality.NextProcessWaste,
Quality.ProdStatus, Quality.ProductType, ProcessQuality.LabourCalc,
ProcessQuality.VarHeadCalc, ProcessQuality.FixedHeadCalc
HAVING (QryRawProcessSumed.ProcessID)=3