Hey All,
I've created 2 crosstab queries and I need to combine them in to one query to give me correct values
Eg: Table 1 record 1 total is 100.00 and Table 2 record total is -25.00, I need to sum them together to give me a query which shows 75.00.
I am looking at a Union Query to do this, but I am really new to unions, please can you look at this and see if I am on the right lines, what should my query code be please? (I need to sum Total and Group Year then MonthNo) Should it even be a union query?
Thank you,
Malcolm
I've created 2 crosstab queries and I need to combine them in to one query to give me correct values
Eg: Table 1 record 1 total is 100.00 and Table 2 record total is -25.00, I need to sum them together to give me a query which shows 75.00.
I am looking at a Union Query to do this, but I am really new to unions, please can you look at this and see if I am on the right lines, what should my query code be please? (I need to sum Total and Group Year then MonthNo) Should it even be a union query?
Thank you,
Malcolm
Code:
SELECT
BreakfastPurchasesInvoiced.Year,
BreakfastPurchasesInvoiced.MonthNo,
BreakfastPurchasesInvoiced.Total
FROM BreakfastPurchasesInvoiced
UNION SELECT
BreakfastPurchasesCredit.Year,
BreakfastPurchasesCredit.MonthNo,
BreakfastPurchasesCredit.Total
FROM BreakfastPurchasesCredit
ORDER BY Year, MonthNo;