|
Hi, I'm using MS Access 2003 and I have two tables, tablePatients and tableTreatments where tablePatients contains a specific patient and any of these patients may have one or more treatments which is linked to tableTreatments. Eg:
So far I've used this question to retrieve all patients and their treatment:
But now I would like to retrieve only the second (or third, or fourth or X..) treatment for all the patients based on the treatment date, so using the example above the data I would like to retrieve is:
Is there anyone having an idea? Merry christmas, Roger
(comments are locked)
|
|
Hi, You may use the below query.
hope this would help Hi Dinesh, a big thanks for your comment! The solution works as such that it delivers only the latest treatments. But what I want is a solution where I can specify which treatment in order that I want to retrive. For example if I want to retrieve the details for the second treatment for all patients (or the third, or the forth)? How do I do that?
Dec 21 '09 at 07:38 AM
Roger Olofsson
(comments are locked)
|


are you trying to get top 2 entries after the join or is there more to the requirement?
Good effort on showing the data. It'll also help if you show the data (maybe up to 4 entries for this question), and expected result from that data.