Feb 26 2006, 08:02 PM
Rather than having a "Purchases in a date range" report how to I get a report or query to kick back only the last five purchases per ProductID? Some items I purchase twice a week and others only twice a year, I would like to have a report that can give me historical value for every item that will not be 100 pages long. Thanks
Feb 26 2006, 08:37 PM
Welcome to UtterAccess!
This will require a subquery using the Top 5 predicate. Are you familiar with subqueries?
Feb 26 2006, 09:04 PM
I used a subquery once to obtain a unitprice for items. The more I got used to the programming language I found it reduntant and replaced it with a simple expression. I should be able to remember how to do it.
Feb 26 2006, 09:06 PM
It is often easier to create and save the subquery first then add it to your new query. If you are comfortable writing a SQL Select statement yourself then you can simply include it as one of the fields in your query.
Feb 26 2006, 09:15 PM
So what you are saying is make a subquary for the ProductId and date, then sort the date in decending order. Apply a predicate function to the date and swap the date fields in my main query. The only thing I'm hung up on is how to create the predicate function.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here