I have a table with three fields, looks like this...........
tblValues
NameFrom NameTo Difference
abbbb arrrr 16
acccc agggg 20
adddd annnn 17
My query looks like this...
Select 'From' = tblValues.NameFrom,
'To' = tblValues.NameTo,
TblValues.Difference,
'Other' = x1.Difference
from tblValues
LEFT JOIN tblValues X1
ON tblValues.NameFrom = X1.NameTo
AND tblValues.NameTo = X1.NameFrom
WHERE tblValues.NameFrom Like '%a%' OR tblValues.NameTo Like '%a%'
ORDER BY tblValues.NameFrom, tblValues.NameTo
I let user search a text value in this case 'a'. I have about 30000 values that are not edited/updated by anyone. They've been entered into this table and have been as they are.
The data looks like this....
From To Difference Other
abbbb arrrr 16 16
.... ....
'Same for all the values - or at least that's what it should be!
The problem i have is that when I run this query there are a few records where OTHER = NULL - even though Difference has a value. Any idea why?