Computing.Net > Forums > Windows XP > Top Values Per Group by Date Report

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Top Values Per Group by Date Report

Reply to Message Icon

Name: xsg
Date: July 30, 2009 at 07:20:46 Pacific
OS: Windows XP
Product: Microsoft Access 2000/visual basic f/applications fundamentals
Subcategory: Software Problems
Comment:

I have been messing around in MS Access for quite a while trying to get a report just the way I want it but have been unsuccessful. Help please! I have 13 customer types, many businesses within those types, and a lot of sales to each of those businesses that I would like to sum. Here's where the date regulation comes in, I want the user to be able to input the dates he/she wants. I believe I have done this by adding my DateShip field to the query, not showing, with the criteria: Between [Begin Date] AND [End Date]

After the sales are summed and ranked, I also just would like the top ten for each customer type.

I have tried following the example on http://support.microsoft.com/kb/208822 but my tables are not set up that way. I have three tables, Customers, Invoice Detail, and Invoice, with the fields CustID, CustType,BusinessName; InvNo, UnitCost, QtyShipped; and CustID, InvNo; respectively. I also have a query with all these fields, but would this not be wise to base this type of query/report of another query?

Here is the query I have now:
SELECT TOP 10 Customers.CustType, Customers.BusinessName, Sum([Invoice Detail]![UnitCost]*[QtyShipped]) AS Sales
FROM (Customers INNER JOIN Invoices ON Customers.CustID = Invoices.CustID) INNER JOIN [Invoice Detail] ON (Invoices.InvNo = [Invoice Detail].InvNo) AND (Invoices.InvNo = [Invoice Detail].InvNo)
GROUP BY Customers.CustType, Customers.BusinessName, Invoices.InvNo, Invoices.DateShip
HAVING (((Customers.CustType)=[Report]![TopBusinessByCustType]![CustType])
AND ((Invoices.DateShip) Between [Begin Date] And [End Date]))
ORDER BY Sum([Invoice Detail]![UnitCost]*[QtyShipped]) DESC;

The report it's viewing has the customer type listed twice next to itself- was trying to follow the method of the link above. Problems with this is it's not summing all the sales for the dates given. Rather, it's listing Company A with sales 1,2,3, and 4.

Am I headed in the right direction, or way off? Any ideas or suggestions please? I'm realatively new to Access but picking it up pretty quickly. Thank you so much in advance for any help!



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Top Values Per Group by Date Report

Batch file to delete by date www.computing.net/answers/windows-xp/batch-file-to-delete-by-date-/135330.html

Arange Icons by Date www.computing.net/answers/windows-xp/arange-icons-by-date/73399.html

Listing Hotfix by date. www.computing.net/answers/windows-xp/listing-hotfix-by-date/85058.html