I'm a bit stuck with a problem that I find even hard to explain.
I want to output all records where ID is (say) 39 from main table "Dat". That seems fairly straightforward
Select Dat.Z, Dat.FieldA, Dat.FieldB, Dat.FieldC from Dat Where Dat.ID= 39
But the output needs to include those with a possible substitute ID so I made a lookup table 'Dupes' with 4 fields and example contents:
ID 39
Z "A4"
SubstituteID 1143
SubstituteZ "B6"
Wanted are records where ID is 1143 (instead of 39) and Dat.Z is 'B6' but shown as 'A4'
I can't seem to get the SQL right, or be sure it can all be done in one statement.
Thanks for any help.
I want to output all records where ID is (say) 39 from main table "Dat". That seems fairly straightforward
Select Dat.Z, Dat.FieldA, Dat.FieldB, Dat.FieldC from Dat Where Dat.ID= 39
But the output needs to include those with a possible substitute ID so I made a lookup table 'Dupes' with 4 fields and example contents:
ID 39
Z "A4"
SubstituteID 1143
SubstituteZ "B6"
Wanted are records where ID is 1143 (instead of 39) and Dat.Z is 'B6' but shown as 'A4'
I can't seem to get the SQL right, or be sure it can all be done in one statement.
Thanks for any help.