I'm not very good with the Jet Base langauge syntax. :(
Basically I have Access 2003, and under the SQL view, I have this,
SELECT Expenses.Category, Sum(Expenses.Amount) AS SumOfAmount
FROM Expenses
GROUP BY Expenses.Date, Expenses.Category
HAVING (((Month([Date]))=[Enter Month, 1-12]) AND ((Year([Date]))=[Enter
Year, "YYYY"]) AND ((Expenses.Category)=[Category: Normal Meals, Special
Dining, Transportation, Entertainment, Bills, Essentials, Desires]));
Where do I change such that after I run the query, it shows the figure for
the whole month instead of daily totals.
Thanks
Try
SELECT Format([Date], "mmm dd"), Category, Sum(Amount) AS SumOfAmount
FROM Expenses
WHERE Month([Date])=[Enter Month, 1-12]
AND (Year([Date])=[Enter Year, "YYYY"]
AND Category = [Category: Normal Meals, Special Dining, Transportation,
Entertainment, Bills, Essentials, Desires]
GROUP BY Format([Date], "mmm dd"), Category
Note that Date is not a good choice for a field name: it's a reserved word.
If you cannot (or will not) change it, at least put on square brackets like
I did. Note, too, that it's more efficient to use WHERE than HAVING. With
WHERE, data is eliminated before it's consolidated. With HAVING, it's
consolidated then deleted.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I'm not very good with the Jet Base langauge syntax. :(
> Basically I have Access 2003, and under the SQL view, I have this,
[quoted text clipped - 37 lines]
>> > is create a daily total within the particular month for a particular
>> > category. I used the total button and did sum for the field "Amount".
Yude - 20 Jun 2007 04:00 GMT
I did some trial and error on both suggestions. I tried using WHERE, but the
system kept saying there's a syntax error. And I took your advice to rename
the DATE field. So this is the current code that seems to work,
SELECT Month([Expense_Date]) AS ExpenseMonth, Year([Expense_Date]) AS
ExpenseYear, Expenses.Category, Sum(Expenses.Amount) AS SumOfAmount
FROM Expenses
GROUP BY Expenses.Category, Month([Expense_Date]), Year([Expense_Date])
HAVING (((Month([Expense_Date]))=[Enter Month, 1-12]) AND
((Year([Expense_Date]))=[Enter Year, "YYYY"]) AND
((Expenses.Category)=[Category: Normal Meals, Special Dining, Transportation,
Entertainment, Bills, Essentials, Desires]));
> Try
>
[quoted text clipped - 53 lines]
> >> > is create a daily total within the particular month for a particular
> >> > category. I used the total button and did sum for the field "Amount".