Thank you everyone for your help with this project. I think I'm at the point where I can ask the right question.
I have a series of queries used for a fiscal dashboard. The main data source is a list of fund control points (FCP), and then I have a separate queries to show budget, spent, obligated, planned, etc. What I'd like to do is take each of these queries and turn them into an expression in a larger query. So for example...
Code:
SELECT TFiscalData.FCP, Sum(TFiscalData.Cost) AS DashBudgetTotal
FROM TFiscalData
WHERE (((TFiscalData.TransactionPrimary)="BUDGET"))
GROUP BY TFiscalData.FCP;
and
Code:
SELECT TFiscalData.FCP, Sum(TFiscalData.Cost) AS DashObligatedTotal
FROM TFiscalData
WHERE (((TFiscalData.TransactionPrimary)="Expense"))
GROUP BY TFiscalData.FCP, TFiscalData.PoStatus
HAVING (((TFiscalData.PoStatus)="Obligated"));
Would each be a subquery in a larger query. This would make it exponentially easier to change it later for say, changing what fiscal year it's looking at. Unfortunately I only understand the most basic of expressions, like "DashBudgetTotal: Sum(Cost)", what do I need to do to turn all that SQL into an expression?