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
raj123raj123 

Date comparison in Soql

I have a requirement to compare the lastmodified date on access object ,  to the user input of no of days backs wards,  

 

i need to find whether the lastmodifieddate is less that the user input of no of days backwards from visualforce page

 

what i am doing is 

 

date d = system.today().addDays(-strNoDays);

(Select Id,last_modifieddate,Received_Date__c From  Access__c where last_modifieddate >= d and received_date__c = null)

 

i am getting Compile Error: unexpected token: 'd' at line 459 column 324  

 

Ay one has any ideas of doing this comparison

SuperfellSuperfell

[Select Id,last_modifieddate,Received_Date__c From  Access__c where last_modifieddate >= :d and received_date__c = null]