Date range filtering results
I'm a relative newbie, I've found some other posts on date range filtering but they don't quite seem to do what I need and I'm not sure how to tweak them.
Here's the situation, I'm creating invoices for distribution partners based on royalty agreements. I'm using the distribution partner ID to pull entries from "books" (table on MySQL). Books is then pulling data from "sales" (table on MySQL), which logs individual sales transactions of each book (with date). I need to be able to filter a date range of "sales" to only be looking at the set of data which is between my start and end dates (defined as global variables in a local table).
I've got this setup working with a portal, and portal filtering, just fine, but we need to be able to print these to hard copy and it doesn't seem like portals are the best choice for something you need to print. I've got "go to related records" successfully pulling up the records I need from "books" and displaying most of what I need in a new layout suitable for printing, but the total results aren't filtered by date range at all. As in, if we sold five copies of a book in a month, and I filter by 12/1/11-12/31/11, I need to only get the records associated with transactions occuring within that date range. Instead, on the GTRR, I'm getting all 90 some sale for the entire data set associated with that ISBN.
How do I shoehorn date filtering into this setup?