Grouping by Month/Year in Report

Montez659

Well-known Member
Joined
May 4, 2005
Messages
918
I am having trouble getting my report to populate like I would want, and I am sure that this is a fairly common problem with a common solution, but I am just not getting the result that I want.

Basically, I have many transactions that will take place in the future and I want to display them on a report. My table has a field futTransDateProcessed which is where I get the date from. From there, I built two expressions in a query, one to pull the month and the other to pull the year (showMonth, showYear) and added these as grouping levels.

The problem seems to be that it want's to form a new group anytime the date is different, instead of anytime the month or year is different. For instance, since 7/26/2011 and 7/27/2011 are two different dates, there will be two different headers, each saying July 2011. I would want all of the July dates grouped under one heading.

What am I doing wrong? Here is the SQL from the query that this report is based off of:
Code:
SELECT tblFutureTransactions.futTransAmount, tblFutureTransactions.futTransDateProcessed, MonthName(Month([futTransDateProcessed])) AS displayMonth, tblFutureTransactions.futTransDescription, Month([futTransDateProcessed]) AS monthNum, Year([futTransDateProcessed]) AS yearNum
FROM tblFutureTransactions
ORDER BY tblFutureTransactions.futTransDateProcessed;
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Why is there no group by clause in the query?
 
Upvote 0
Montez

I think it is possible to do it in the report.

Why not try using the the report wizard?

I think that might have options you can use.

If you get it working that way you can look at how the report's been formatted etc.
 
Upvote 0
I think I originally used the wizard, but that may have been before I created the expressions for Month and Year. I know sometimes the reports can get finicky if you try to group and sort after it has been created. I think I will go back and try the wizard again now that I have all the fields set the way they need to be.

I will post back to let the world know whether it works or not.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top