I am trying to query counts of an custom object records but i also need to filter out the records. so when i am using single quotes for where clause getting error as:
Error: dailyHLAReportDashboardController Compile Error: expecting a right parentheses, found 'Active' at line 6 column 201
I am trying to use below statement in visualforce controller.
Integer HLA_Signed_By_Customer = database.countQuery('Select id from Hardware_Loan_Agreement__c where CreatedDate>=:Date.today().addDays(-5) and CreatedDate<=:Date.today() and Primary_Status__c = 'Active'');
How can I fix this error?