Custom Query returning error when executed in Query Builder UI

See:

And please stop cross posting the same issue.