Right off the bat, union queries are not my 'cup of tea'.
My intent is to provide a monthly total for each category. This works as advertised.
The union query is intended to show a overall monthly total for all categories. This too works as advertised.
My problem is to show "Grand Total" as the last item. As written, "Grand Total" is displayed based on the overall alphabetic order.
Not even sure it's possible to do what I'm after. I'm wide-open for suggestions.
Thanks, Bob
Code:
SELECT
tblCat.Category
, Sum(tblTransfer.PayAmt) AS SumOfPayAmt
FROM
tblCat
RIGHT JOIN
tblTransfer
ON
tblCat.CatID = tblTransfer.CatID
WHERE
(((tblTransfer.ExpDte) Between DateValue([enter mm/yyyy])
AND
DateAdd("m",1,DateValue([enter mm/yyyy]))-1))
GROUP BY
tblCat.Category
UNION SELECT
"Grand Total"
, Sum(tblTransfer.PayAmt) AS MonthlyTotal
FROM
tblTransfer
WHERE
(((tblTransfer.ExpDte) Between DateValue([enter mm/yyyy])
AND
DateAdd("m",1,DateValue([enter mm/yyyy]))-1));
My intent is to provide a monthly total for each category. This works as advertised.
The union query is intended to show a overall monthly total for all categories. This too works as advertised.
My problem is to show "Grand Total" as the last item. As written, "Grand Total" is displayed based on the overall alphabetic order.
Not even sure it's possible to do what I'm after. I'm wide-open for suggestions.
Thanks, Bob