B
BarryNeaves
Guest
I am trying to write an sql statement in Access 97 to check two identical fields in separate tables and responding from a different table if Null, or from possibly two tables if true.
My crap code currently looks like this...
IIf([adult_education_extract]![Title]= " " or [casual_supply_extract]![title]=" ",[payroll_data_extract]![title],([title]![title_code] or [title_1]![title_code])) AS Title
I am looking at Title in Adult Ed and Casual Supply, if entry in there, return mapping code from Title or Title_1, if not return entry from payroll extract. Make sense? sounded better in my head....
Not pretty or working... It currently returns some answers (-1), although incorrect...
My joins are as follows:
FROM ((((payroll_data_extract LEFT JOIN Casual_Supply_extract ON payroll_data_extract.[NI Number] = Casual_Supply_extract.Nino) LEFT JOIN adult_education_extract ON payroll_data_extract.[NI Number] = adult_education_extract.NINUMB) LEFT JOIN Title ON Casual_Supply_extract.title = Title.description) LEFT JOIN Title AS Title_1 ON adult_education_extract.TITLE = Title_1.description);
I have tried using a single "Title mapping table" but get the error:
"The SQL statment could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include the query in your sql statment."
Can anyone help??
Kind regards.
Barry Neaves
My crap code currently looks like this...
IIf([adult_education_extract]![Title]= " " or [casual_supply_extract]![title]=" ",[payroll_data_extract]![title],([title]![title_code] or [title_1]![title_code])) AS Title
I am looking at Title in Adult Ed and Casual Supply, if entry in there, return mapping code from Title or Title_1, if not return entry from payroll extract. Make sense? sounded better in my head....
Not pretty or working... It currently returns some answers (-1), although incorrect...
My joins are as follows:
FROM ((((payroll_data_extract LEFT JOIN Casual_Supply_extract ON payroll_data_extract.[NI Number] = Casual_Supply_extract.Nino) LEFT JOIN adult_education_extract ON payroll_data_extract.[NI Number] = adult_education_extract.NINUMB) LEFT JOIN Title ON Casual_Supply_extract.title = Title.description) LEFT JOIN Title AS Title_1 ON adult_education_extract.TITLE = Title_1.description);
I have tried using a single "Title mapping table" but get the error:
"The SQL statment could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include the query in your sql statment."
Can anyone help??
Kind regards.
Barry Neaves
Last edited: