You need to sign in to do that
Don't have an account?
Dano Blevins
SOQL Query with related subquery on related object
We have a field on Account and on a custom object called Program that is named the same thing and I am trying to query to see which Programs have Program.Status_Internal__c that != Account.Status_Internal__c.
This is the SOQL I am trying
This gives me two errors, one on the WHERE clause and if you remove the WHERE Clause it still gives me the following error:
ERROR at Row:2:Column:48
Didn't understand relationship 'Program__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
What is needed to make this QUERY work correctly?
This is the SOQL I am trying
SELECT ID,Status_Internal__c, (SELECT ID,Status_Internal__c FROM Program__r) FROM Account WERE Account.Status_Internal__c != Program__r.Status_Internal__c
This gives me two errors, one on the WHERE clause and if you remove the WHERE Clause it still gives me the following error:
ERROR at Row:2:Column:48
Didn't understand relationship 'Program__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
What is needed to make this QUERY work correctly?
All Answers
This works but also I cannot do the where clause to filter results.