I grouped the data but don't see sum appear when I run the query

G

Guest

SELECT CashReceiptAmount AS "Cash","" AS "Sales"
FROM tblCashReceipts
Where Datepart("M",[CashReceiptDate])=[Month]
GROUP BY CashReceiptAmount
UNION select "", Extension
FROM qryInvoice
Where Datepart("M",[InvoiceDate])=[Month];
GROUP BY Extension

I want to be able to have CashReceiptdate totalled and Extension but it is
not working with the above query what am I doing wrong?
 
D

Duane Hookom

If these are both numeric fields, don't inject a string value of "". Use
either Null or 0.

SELECT CashReceiptAmount AS Cash, 0 AS Sales
FROM tblCashReceipts
Where Datepart("M",[CashReceiptDate])=[Month]
GROUP BY CashReceiptAmount
UNION select 0, Extension
FROM qryInvoice
Where Datepart("M",[InvoiceDate])=[Month];
GROUP BY Extension
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top