Yes I understand your concern about Table C & D....
However - I have tried to reduce things to a minimum
so that's why it might look a bit strange. There are other
fields in C & D that make it sensible to have different tables
from a normalisation point of view...
I agree with your soluton but it is still not working for me !
Perhaps I'm just missing something real simple. I have been
fighting with this for so long that I'm probably just tooo close to it!
I'm getting a "syntax Error..." so let me come clean...
Table A = tblExpenseDescriptions - fields - ID and ExpenseDescription...
Table B = tblProjects - fields - ID and ProjectName...
Table C = tblPrjLinesCapital - fields - ID, SomeText, ExpenseDescriptionID,
ProjectID ...
Tabe D = tblPrjLinesNonCapital - fields - ID, SomeText,
ExpenseDescriptionID, ProjectID...
so when I try to run .....
SELECT tblPrjLinesCapital.ProjectID, tblProjects.ProjectName
FROM tblPrjLinesCapital INNER JOIN tblProjects
ON tblPrjLinesCapital.ProjectID = tblProjects.id INNER JOIN
tblExpenseDescriptions
ON tblPrjLinesCapital.ExpenseDescriptionID = tblExpenseDescriptions.ID
WHERE tblExpenseDescriptions.ID = somenumber
UNION ALL
SELECT tblPrjLinesNonCapital.ProjectID, tblProjects.ProjectName
FROM tblPrjLinesNonCapital INNER JOIN tblProjects
ON tblPrjLinesNonCapital.ProjectID = tblProjects.id INNER JOIN
tblExpenseDescriptions
ON tblPrjLinesNonCapital.ExpenseDescriptionID = tblExpenseDescriptions.ID
WHERE tblExpenseDescriptions.ID = somenumber
I get a Syntax error (missing operator) in expression ....
"tblPrjLinesCapital.ProjectID = tblProjects.id INNER JOIN
tblExpenseDescriptions
ON tblPrjLinesCapital.ExpenseDescriptionID = tblExpenseDescriptions.ID"