jackadamson
New member
- Local time
- Today, 21:14
- Joined
- Jul 18, 2011
- Messages
- 7
I am an access novice and need some help pretty badly. My problem is as follows:
I have two tables of data like below
Table1
TopCode SubCode Item
ABC ABC FishA
ABC ABCD FishB
ADF ADFG PhoneA
ADF ADFH PhoneB
Table 2
SubCode Date
ABC 01/01/2001
ABCD 01/01/2001
ADFG 05/02/2003
ADFH 04/02/2003
I want to run a query that produces the following
TopCode Date
ABC 01/01/2001
ADF 04/02/2003
Where the date is added by matching the SubCode from Table 2, with the TopCode from Table 1. If there is no TopCode match, I would like the match to be made by matching the SubCode from Table 2, with the SubCode from Table 1 with the oldest date chosen (e.g. 04/02/2003 rather than 05/02/2003).
At the moment all I have is
TopCode Date
ABC 01/01/2001
And ADF is removed from the result.
Can any Access wizards help with this problem?
I would really appreciate a reply
I have two tables of data like below
Table1
TopCode SubCode Item
ABC ABC FishA
ABC ABCD FishB
ADF ADFG PhoneA
ADF ADFH PhoneB
Table 2
SubCode Date
ABC 01/01/2001
ABCD 01/01/2001
ADFG 05/02/2003
ADFH 04/02/2003
I want to run a query that produces the following
TopCode Date
ABC 01/01/2001
ADF 04/02/2003
Where the date is added by matching the SubCode from Table 2, with the TopCode from Table 1. If there is no TopCode match, I would like the match to be made by matching the SubCode from Table 2, with the SubCode from Table 1 with the oldest date chosen (e.g. 04/02/2003 rather than 05/02/2003).
At the moment all I have is
TopCode Date
ABC 01/01/2001
And ADF is removed from the result.
Can any Access wizards help with this problem?
I would really appreciate a reply