all records Parent-last records child

pablavo

Registered User.
Local time
Today, 00:16
Joined
Jun 28, 2007
Messages
189
I've posted something similar on the queries section and thought it would be clearer if I explained it here.

I want to generate a report that will show records from a multi-table query.

The two main tables are "tblProject" and "tblDisbursal". these tables have an indirect one - many relationship.

On the report I want to show ALL project records from "tblProject" and only the last created records from "tblDisbursal" for each project (If there are 3 Disbursals for a particuar project, the report would only show record "3")

For each Project there can be several records from tblDisbursals. It's only the last created record I'm interested in seeing on the report.

I had a look at the TOP predicate and can't see how this would work if I still wanted to show all the records from "tblProject"

Perhaps I have to create a query within a query? or there's a way I can manipulate the form to give me the results.
My exerience is not great on this part so maybe someone can help?:eek:
 
Create a query based on tblDisbursal that selects only the most recent record for each project (use TOP1 or Max in an aggregate query). Join this query in a new query with tblProject.
 

Users who are viewing this thread

Back
Top Bottom