S
Stacey Crowhurst
Hi. I have a query that is the source for a report on construction budgets.
I want the data to be rolled up (which would be 32 rows). But I need the
pstStatusID field in the query becuase a filter searches that field before
opening the report. The status ID is "design" or "feasibility" or
"construction" etc. And I have a multiselect list box that allows the user
to choose which phases to get the budget report data for. So I need the
pstStatusID field, but having it in the query mutiplies the result rows.
I'll get the following:
Type-budBudgetCodeID-bcBudgetCodeDesc-Initial Budget-Revised Budget-Current
Budget
Hard Costs -105-100-Construction Contracts-500-0-500
Hard Costs -105-100-Construction Contracts-1500-0-1500
Instead of
Hard Costs -105-100-Construction Contracts-2000-0-2000
How do I work around that?
Here is the SQL:
SELECT qryInitialRevisedCurrentBudget.Type,
qryInitialRevisedCurrentBudget.budBudgetCodeID,
qryInitialRevisedCurrentBudget.bcBudgetCodeDesc,
Sum(qryInitialRevisedCurrentBudget.InitialBudget) AS [Initial Budget],
Sum(qryInitialRevisedCurrentBudget.RevisedBudget) AS [Revised Budget],
Sum(qryInitialRevisedCurrentBudget.CurrentBudget) AS [Current Budget],
qryInitialRevisedCurrentBudget.pstStatusID
FROM qryInitialRevisedCurrentBudget
GROUP BY qryInitialRevisedCurrentBudget.Type,
qryInitialRevisedCurrentBudget.budBudgetCodeID,
qryInitialRevisedCurrentBudget.bcBudgetCodeDesc,
qryInitialRevisedCurrentBudget.pstStatusID;
Thanks a million!!! Stacey
I want the data to be rolled up (which would be 32 rows). But I need the
pstStatusID field in the query becuase a filter searches that field before
opening the report. The status ID is "design" or "feasibility" or
"construction" etc. And I have a multiselect list box that allows the user
to choose which phases to get the budget report data for. So I need the
pstStatusID field, but having it in the query mutiplies the result rows.
I'll get the following:
Type-budBudgetCodeID-bcBudgetCodeDesc-Initial Budget-Revised Budget-Current
Budget
Hard Costs -105-100-Construction Contracts-500-0-500
Hard Costs -105-100-Construction Contracts-1500-0-1500
Instead of
Hard Costs -105-100-Construction Contracts-2000-0-2000
How do I work around that?
Here is the SQL:
SELECT qryInitialRevisedCurrentBudget.Type,
qryInitialRevisedCurrentBudget.budBudgetCodeID,
qryInitialRevisedCurrentBudget.bcBudgetCodeDesc,
Sum(qryInitialRevisedCurrentBudget.InitialBudget) AS [Initial Budget],
Sum(qryInitialRevisedCurrentBudget.RevisedBudget) AS [Revised Budget],
Sum(qryInitialRevisedCurrentBudget.CurrentBudget) AS [Current Budget],
qryInitialRevisedCurrentBudget.pstStatusID
FROM qryInitialRevisedCurrentBudget
GROUP BY qryInitialRevisedCurrentBudget.Type,
qryInitialRevisedCurrentBudget.budBudgetCodeID,
qryInitialRevisedCurrentBudget.bcBudgetCodeDesc,
qryInitialRevisedCurrentBudget.pstStatusID;
Thanks a million!!! Stacey