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
Shanky77Shanky77 

How to compare DATE using greater/Smaller(>) sign

I have to compare Date fileld of a particular object with another Date field.

 

Like Start_date__c >= End_Date__c ( will it work in Apex? if not then waht is the syntax)

JimRaeJimRae
That should work fine.  Are you getting an error?  If so, post your code, and the exact error message.
arunkarunk

Hi,

 

That should work ...

 

 

Reagrds,

Arun 

SuperfellSuperfell
If you're trying to do this in SOQL, then you cannot compare one field to another in SOQL.
arunkarunk

Hi, 

 

Or you will need two queries, one to get a field and then you can use it in the next query ... 

 

 

Regards,

Arun