• ICATLogistics
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

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