I've found the problem. When constructing the SELECT statement for the LINK table it was adding an extraneous
AND <link_table>.rdcaccount_id='whatever'
to the WHERE clause. By removing it I got it to select the correct records. The attached file contains the fix.