1. If using multiple lines, check for blank spaces left out at the end of each line. This will cause the entire SQL string to concatenate and be read as one long string. For example:
"RECORDS.ID IN (SELECT RECORDS.ID FROM RECORDS AS RECORDS" +
The space missing at end of the highlighted section above would result in
2. Missing escape characters or closing brackets. For example:
"WHERE(RECORDS.IS_CONSTITUENT = -1"