>I am still working on this problem and have decided to tear apart my code into pieces and see what works in pieces and then try to put it together again. I tried Sergey's code but it didn't like something about that, so I am, as I said, tearing it apart again and will see what can be put back together again.
>
That code looked perfectly correct to me, but I was just looking at it, not trying <g>
Ok, so try both of your INNER SQL-statements alone, verify that the result is correct and join afterwards.
If it's not broken, fix it until it is.
My Blog