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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
Back
Top