this is most likely an issue with the INNER JOIN.
For the inner join to return a result, the join criteria must have a match.
If the join does not find a match, no results will be returned regardless of a match with the where clause.
You may want to try experimenting with using a left join, or an outer join instead of inner join.
for details on the types of joins see the following :