Solved: Access: group by field in a report

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Zack Barresse

Thread Starter
Joined
Jul 25, 2004
Messages
5,458
Hi all,

I'm trying to create a report based on a small database of info imported from Excel. What I want to do is have the report totalled by month. I created a new field for the main table with an update query that added just the month name (don't know if I need that to total by month or not, there is a date field as well). I've uploaded the database to give a better example.

What I want to end up with is a report that shows a Monthly total for each Source in the database. There are five sources, so this should be 60 different totals. There is a field in the database called 'galTKN', this value should appear in that summary as well. The value will not change and is the same for every record. I was debating creating an extra table for this, but it could change in the future.

Let me know if you need any other information. TIA. :)
 

Attachments

Joined
Aug 5, 2005
Messages
3,086
Wow, lol. Sorry nobody's posted on this yet Zack. I've been off the boards, I'll have a look at it.

chris.
 
Joined
Aug 5, 2005
Messages
3,086
Hehe, or maybe I won't. Any chance of getting that in a 2000 version? Or is there unconvertable code (though I doubt the code should matter)?

chris.
 

Zack Barresse

Thread Starter
Joined
Jul 25, 2004
Messages
5,458
Actually, with the help of pbaldy I got it...

Code:
SELECT Format([galDate],"mmm yyyy") AS TheMonth, tblGallons.galSource, Sum(tblGallons.galTKN) AS SumOfgalTKN, Sum(tblGallons.galGallons) AS SumOfgalGallons
FROM tblGallons
GROUP BY Format([galDate],"mmm yyyy"), tblGallons.galSource, Format([galdate],"yyyymm")
ORDER BY Format([galdate],"yyyymm");
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top