One thing I would test the query that you are attempting to run using the below syntax.
(CUSTOMER'S CUSTOM SQL
) "Custom SQL Query"
The SELECT clause and any WHERE or GROUP BY clauses are formed by Tableau. When testing the query in another tool, make sure you grab the entire query, including the Tableau-generated clauses.
If the query works in the above test there could be something occur with Tableau Desktop and I would open a case with the Tableau Support team.
Hope this helps!