Find the top two children

B

Barbarossa

I am novice access developer and have the following issue:
My access database is designed to help me track my business prospects. Each
time I contact a prospect I enter the date of contact made, a follow-up date
and a memo of what has been discussed etc.

I have designed a report which shows me the customers that need to followed
up for the next period - usually a week - using the "between selection" in my
query. This is easy enough to do but I am trying to restrict the output of
the contacts made to the most recent two.

Tables involved is "tblProspect" (parent) containing the name and address
details of the prospect and the tblContact (child) containg the date
contacted, the follow-up date and the memo field containing information about
the call made.

I have programming experience on networked datebases on mainframes where the
solution to such a problem in COBOL is pudsticks - however, in MS Access I
find myself challanged.

Please help,
Barbarossa
 
A

Allen Browne

Two possibilities:

a) Report with subreport
Create a main report bound to tblProspect.
Create a query using tblContact, and set its Top Values property to 2.
Create a subreport using this query, and make it a subreport.

b) Subquery.
See:
Subquery basics: TOP n records per group
at:
http://allenbrowne.com/subquery-01.html#TopN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top