'Getting syntax error while running pyspark sql command

afer_can_normalized_Data=sql.get_df("select * from form26AS.console_report where active=1 and is_cancelled=0 and is_normalized=1 and assessment_year=%d and company_code='%s' and company_pan='%s' and company_tan='%s' and batch_upload_id='%s'" % (assessmentYear,company_code,company_pan,company_tan,id1))   

Getting this below error while executing the above SQL statement:

com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'select'.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source