i would need to see the structure for the tables you are using in this query to be able to troubleshoot.
when creating join queries, it is a good practice to include the table name in the ON clause:
INNER JOIN table2 ON table1.KeyColumn = table2.RelationColumn
You may have better luck creating your query using a visual query builder like SQLYog or Navicat