You need to sign in to do that
Don't have an account?
Venkata Sravan Kumar Bandari
I can't understand why it is throwing error for this statement
Database.getQueryLocator('select id, name, email, birthdate from contact where calendar_Month(birthdate) =: System.today().month() AND day_In_Month(birthdate) =: SYstem.today().day()');
i have tried in many ways from anonymus also but its not working
ERROR: System.QueryException: unexpected token: '('
i have tried in many ways from anonymus also but its not working
ERROR: System.QueryException: unexpected token: '('
Those statements also not working
i changed like this and it is working.
All Answers
Database.getQueryLocator('select id, name, email, birthdate from contact where calendar_Month(birthdate) = ' + System.today().month() + ' AND day_In_Month(birthdate) = ' + SYstem.today().day());
only simple bind variables are allowed in dynamic SOQL.
Look at the considerations
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_soql.htm
You ar mergning two different syntax with each other when you are generating dynamic query you can't use : operator. Please find the correct version below
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Those statements also not working
i changed like this and it is working.