I have the following tables "Base" and "Join":
Base:
ID  Field
A   1
B   2
D   
Join:
ID
A
B
C
D
I use the following query to select "ExampleQuery" to parse "Base":
SELECT Base.ID, IIf(IsNull([Field]),"None",[Field]) AS Newfield
FROM Base;
And the following select query to the left-join table "Join" for the query "ExampleQuery":
SELECT Join.ID, ExampleQuery.Newfield
FROM [Join] LEFT JOIN ExampleQuery ON Join.ID = ExampleQuery.ID;
My conclusion is as follows:
ID  Newfield
A   1
B   2
C   None
D   None
I expect the value of C to be null since it was not in the ExampleQuery output, however, it uses the logic from the expression in the original query instead. Why is this happening, and how can I prevent it? I want to process my initial select query strictly as a temporary table.
source
share