You need to sign in to do that
Don't have an account?
ICATLogistics
SOQL Query Help
I am attempting to write a SOQL query to find the following. Having trouble with the "join" etc.
We have a Custom Object called Shipment, the parent object is Account.
Related by:
Shipment.SF_Account__c = Account.Id
Shipment has a field called CustomerNo. Account has a field Site. I want a list of Shipment records where CustomerNo does NOT equal the related Account Site.
In SQL it would look like:
SELECT Shipment.ID, Shipment.CustomerNo, Account.Site FROM Shipment INNER JOIN Account ON Shipment.SF_Account__c = Account.ID WHERE Shipment.CustomerNo <> Account.Site
The SOQL query should look like:
SELECT ID, CustomerNo, SF_Account__r.Site FROM Shipment WHERE CustomerNo <> SF_Account__r.Site