jameslagan
Registered User.
- Local time
- Today, 20:16
- Joined
- Jan 13, 2012
- Messages
- 10
I am working on a project with MS Access 2010.
A person with an illness needs to matched against two people without the illness, or controls. These two controls need to be the nearest in terms of age as possible.
I have matched suitable controls but I am struggling to make a query to select just the two controls with nearest dates of birth (Date difference) to the people with the disease.
(The date_difference field is an absolute number so even if they are younger or older the number is always positive - obviously, a higher number indicates they are more years apart).
Can anyone help?
For example... (obviously all names are completely made up!)
LINK(i.imgur.com/dHVxR.jpg)
I would like the outcome of a query to generate the following:
LINK(i.imgur.com/LdInP.jpg)
Any help will be MUCH appreciated!
James
A person with an illness needs to matched against two people without the illness, or controls. These two controls need to be the nearest in terms of age as possible.
I have matched suitable controls but I am struggling to make a query to select just the two controls with nearest dates of birth (Date difference) to the people with the disease.
(The date_difference field is an absolute number so even if they are younger or older the number is always positive - obviously, a higher number indicates they are more years apart).
Can anyone help?
For example... (obviously all names are completely made up!)
LINK(i.imgur.com/dHVxR.jpg)
I would like the outcome of a query to generate the following:
LINK(i.imgur.com/LdInP.jpg)
Any help will be MUCH appreciated!
James