+ Start a Discussion
SFDC n12SFDC n12 

SOQL QUERY HELP NEEDED

Hi,

 I having a requirement where i need to write a soql query for which i need help


1) I am having 2 picklist fields namely ADR MONTH__c and ADR YEAR_c from a custom object where i have to check the date that i create a new record and enter the value of adr month and adr year should be greater than 13 


if the created date is today 10/2014 , the previous records that got created  can be 9/2013


   List<AccountExceptions__c> lstAccExp = [Select Id,Account__c,ADR_Month__c,ADR_Years__c from AccountExceptions__c where Id =:accId ];


i need to check that condition here , help me how to do this


thanks in advance

 

SonamSonam (Salesforce Developers) 
You can't really check the difference in two date fields in SOQL.

Check the following:
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008lQzIAI