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
thechadthechad 

Can I compare two columns with the Query Call?

I would like to perform a query like

Select Id, Name, Amount From Opportunity WHERE Amount != Some_Custom_Field__c

Is this possible... from what I have read in the docs, I gather the answer is no, but really really really want to be wrong.

Thanks for your help.
SuperfellSuperfell
No, the filter value must be a literal value.
thechadthechad
Darn!

I was affraid of that.  Thank you for the prompt reply.
hemmhemm
Create a formula field to do the comparison for you and return 1 or 0.  In your SOQL query, filter on the result of the formula field.