You need to sign in to do that
Don't have an account?
Temple Sutfin
Quirky query. ORDER BY clause not working
Anyone have an idea why this query works just fine:
soql = 'SELECT Name,Status__c,Contractor__c,Name_Of_Job__c,Job__r.Type__c FROM Bid__c WHERE name != null'; runQuery(); }
but this one fails:
soql = 'SELECT Name,Status__c,Contractor__c,Name_Of_Job__c,Job__r.Type__c FROM Bid__c WHERE name != null ORDER BY Name_Of_Job__c'; runQuery(); }
I am not seeing the issue with the ORDER BY clause.
I get this:
System.QueryException: unexpected token: 'ORDER'
Yeah, I am not getting any errors there either. Hence the confuzzlement.
One other thing you could try is to run it as a static query:
Try like this
'SELECT Name,Status__c,Contractor__c,Name_Of_Job__c,Job__r.Type__c FROM Bid__c WHERE name != null '+' ORDER BY Name_Of_Job__c'
Hard to tell from your example, but Is there a line break before the ORDER BY clause?
If so, make sure the entire string is on the same line.