You need to sign in to do that
Don't have an account?
JoyJobing
using AND in WHERE clause? getting error - it must be easy...
I'm getting the following error on this line of code:
Save error: Unexpected token: 'AND'
List<Task> newestTask = new List<Task> ([SELECT id, ActivityDate, AccountId FROM Task WHERE Owner_Matches_Account_Owner__c AND IsClosed AND ID in :ids ORDER BY ActivityDate DESC LIMIT 1]);
I know it must be obvious, but I can't figure out what's wrong with the multiple clauses in the WHERE section? Any ideas?
You need to check the boolean value with true or false like this:
List<Task> newestTask = new List<Task> ([SELECT id, ActivityDate, AccountId FROM Task WHERE Owner_Matches_Account_Owner__c = true AND IsClosed = true AND ID in :ids ORDER BY ActivityDate DESC LIMIT 1]);
All Answers
You need to check the boolean value with true or false like this:
List<Task> newestTask = new List<Task> ([SELECT id, ActivityDate, AccountId FROM Task WHERE Owner_Matches_Account_Owner__c = true AND IsClosed = true AND ID in :ids ORDER BY ActivityDate DESC LIMIT 1]);