Usually - do a debug() which will give you a query itself. Copy-paste query into SQL console. If you get error there, then try to understand why.
You can also use setActualFields to narrow down list of fields queried, which will make your query simpler.
That should help you narrow down the problem.