View Full Version : Null related problem


captnk
04-14-2002, 11:21 PM
Ok ,so I have identified the prob.,but I dont know how to fix it.
I have 2 tables,that r linked by a left to right join on 4 fields.
The idea is to pull a value from the second table (that paricular field is not joined).
On occasions one or more columns in each table may have a null value in one of the fields.
I have tried using "Is not null",but that results in the query finding an alternative item where everything is similar except the null value field ,resulting in the wrong and /or duplicate values being extracted.

I have thought about filling in the nulls in both tables with an alpha or samething,but that long term is tedious as hundred of items r added weekly.

Any suggestions on how to extract the exact item required welcome please.

Pat Hartman
04-15-2002, 06:34 PM
If the query needs 4 join fields, ALL of the fields must be populated for matching rows to be returned. If the exact set of field values does not exist in both tables, NO row will be returned. Additionally, a null field in one table will not join to a null field in another table. Null does NOT = Null. Therefore if some of the fields might be null, you will have to create additional queries that accomodate that and only join on a subset of the fields and that also check the omitted field on both sides of the join for nulls.

I would need to know the exact rules for when these fields may be null to help you further with the additional queries.

captnk
04-17-2002, 04:03 PM
Thanks Pat.
Yes! It looks like the only way out is to create a series of queries.
Getting the number and sequence right is taking a bit of thought.
Thanks