Complex query structure, not working as intended

Printable View