function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ed055Ed055 

SOQL help

I have custom field "Email__c"  on Account . If I try to run below query, 

If I run below query,  I get "Unknown error parsing query"  error. Not sure what I'm doing wrong here. 
SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE   Account.Email__c  != Email

Below query runs successfully 
SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE   Account.Email__c  !=''

Thanks for help.
Swayam@SalesforceGuySwayam@SalesforceGuy
Hi,

Where are you running the query, also you have to use != with String literal as  ' Your Email Id' 

SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE   Account.Email__c  != ' Email Id '

Hope this helps

--
Thanks,
Swayam
 
Gyanender SinghGyanender Singh
Hi Ed055,
Please ues the this soql and it will work fine as per your requirement.
SELECT ID , Account.Email__c  ,Email  FROM Contact WHERE  account.Email__c != 'Email'

Thanks
Gyani
Mirketa Software Pvt. Ltd.
http://www.mirketa.com