Thanks for your reply Allen.
Not all the works numbers in query 3 are in query 4; however the problem
with the inner join is that it returns no records at all whereas the left
join returns the records I would expect. If the inner join worked it would
return the same records as the left join since all the works numbers in query
4 are in query 3. There are many records in query 3 with works numbers that
match records in query 4.
There are no nulls in the works number field in queries 3 or 4.
That's why I'm wondering if the order of execution of queries 4 and 3 is
what is confusing Access. Any thoughts on this? I should have avoided the
use of the term 'directionality' in my initial posting since I was not
referring to the direction of the arrow that joins the two sub-queries in the
QBE grid. I really meant order of execution of the sub-queries. To clarify,
if sub-queries 3 and 4 were tables, I suspect the inner join would work just
fine. But because they are queries, Access must first execute them, but may
be confused by which to execute first when they are joined by an inner join.
Thanks,
Patrick
There's a couple of things that could be going on.
One possibility is that JET is not matching the values from queries 3 and 4
due to a difference in data type. Open the Immediate Window (Ctrl+G) and ask
Access to tell you the type of each field, e.g.:
? CurrentDb.QueryDefs("0106 treat srcedat gwsw
3").Fields("Works_number").Type
Are they the same type? The numbers will match one of the DAO decimal values
from here:
http://allenbrowne.com/ser-49.html
If they are text type (10), you might also look at the Len() of the fields
you expect to match. There may be a spurious character embedded in the
field, such as a space, tab, or nullchar.
A compact/repair would also be worthwhile, in case the problem is a bad
index.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Thanks for your reply Allen.
>
[quoted text clipped - 83 lines]
>> > Thanks,
>> > Patrick
PatrickM - 28 Mar 2008 15:21 GMT
Allen, doesn't the successful left join prove that this is not a data type
issue? Incidentally, sub-queries 3 and 4 extract data from the same table.
The works number I'm joining them on comes from the same field in the same
table.
I tried the compact and repair but the inner join still returns no records.
Thanks,
Patrick
> There's a couple of things that could be going on.
>
[quoted text clipped - 101 lines]
> >> > Thanks,
> >> > Patrick
Allen Browne - 28 Mar 2008 16:26 GMT
Patrick, there's nothing further I can suggest from the information you
supplied.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen, doesn't the successful left join prove that this is not a data type
> issue? Incidentally, sub-queries 3 and 4 extract data from the same
[quoted text clipped - 126 lines]
>> >> > needs
>> >> > for executing the sub-queries. Is my understanding correct?
PatrickM - 28 Mar 2008 16:46 GMT
Allen, no problem, I appreciate your taking the time to make several responses.
Patrick
> Patrick, there's nothing further I can suggest from the information you
> supplied.
[quoted text clipped - 129 lines]
> >> >> > needs
> >> >> > for executing the sub-queries. Is my understanding correct?