You need to sign in to do that
Don't have an account?
rajgopal10
I have below two fields are here, RenewalDate__c and Today
I want to checking below code in my where condition, but here i am getting error like unexpected token: '-'
RenewalDate__c- Today <= 31
how i can check this condion ?
Getting the error in SOQL query in where condition during checking the date field
I have below two fields are here, RenewalDate__c and Today
I want to checking below code in my where condition, but here i am getting error like unexpected token: '-'
RenewalDate__c- Today <= 31
how i can check this condion ?
you can not perform expressions in a query where clause. use literal in the query as below
SELECT Id FROM Opportunity WHERE RenewalDate__c > NEXT_N_DAYS:31
It will work for you.
let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com
Please tell us the actual requirement here so that it will be easy to provide the solution.
Regards,
Mahesh
I have query as below:
Map<Id,Opportunity> oppMapExt = new Map<Id,Opportunity>([select id,name,Opportunity_Name_Encrypted__c,accountid,account.name,StageName,ProductClass__c from opportunity where accountid IN: accIds AND ProductClass__c IN: lobset AND StageName <>'Closed Won' and StageName <>'Closed Lost' and Quotation__c=null]);
But here i want give
below condition in where condition
and (RenewalDate__c- Today <= 31 or Today - RenewalDate__c<= 31)
Hi Raj,
Please look into the below code:
Please do let me know if it helps you.
Regards,
Mahesh