var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Null values in Join
I need to join two tables together where the foreign key has valid values that are null.
Is there anyway to join on a null value in Access without having to create a separate table and populate that table some value for "null"? (Which is what I usually do but it would be really frustrating in this case.)
Try using left or right join.
Left or Right
Nope, 'cause I have to join to the null value. If I do the a left Join then the "right" table values return with all null values.
Basically, I need to join where Tbl1_Fld1 = 123 and Tbl2_Fld2 = Null to Tbl2_Fld1 = 123 and Tbl2_Fld2 = Null.
So usually what I do is I create two scratch tables where I do something like Nz(Fld1, "Null") but it just doesn't work well here.
Last edited by Mr_Yabbo; 02-07-06 at
You said tbl1_fld2 is null twice. Looks to me like you're joining tbl1_fld1 to tbl2_fld1 WHERE tbl2_fld2 IS NULL.... so do that...
Originally Posted by
FROM tbl1 INNER JOIN tbl2 ON tbl1.fld1 = tbl2.fld1
WHERE tbl2.fld2 IS NULL
Sorry...should have read.
Tbl1_Fld1 = 123 and Tbl1_Fld2 = Null to Tbl2_Fld1 = 123 and Tbl2_Fld2 = Null
So add tbl1_fld2 IS NULL to your where clause. You're overthinking it, I think...
If I understand what you are trying to do, the answer is no. Assuming your data looked like
And you wanted:
If this is correct, then you cannot do it because no two nulls are ever equal. So in this case the 1 and the 3 match but the nulls never match and so you won't show any rows in your query.
Which is why you specify the null criteria in the WHERE clause as opposed to the FROM clause....