I need exactly like your query as you mentionded above. But with small chagne, like
I want to compare two date fields by a dynamic soql. Query like : CALENDAR_MONTH(CreatedDate) <=CALENDAR_MONTH(Time_Based_Mgmnt__r.End_Date__c)
It throws error like " expecting a colon, found 'CALENDAR_MONTH' " .
So please confirm me how to compare these two months. If i put the colon(:), getting another error " unexpected token: ( " . So please help me on resolving this bug.
SELECT ... FROM ... WHERE CreatedDate = THIS_MONTH
Inside apex code:
if(record.CreatedDate.month()==Date.Today().month()&&record.CreatedDate.year()==Date.Today().year()) ....
Thanks but if i want a particular month how do i get it
CreatedDate = January
how could i do it
SELECT ... FROM ... WHERE CALENDAR_MONTH(CreatedDate)=1
See the SOQL reference for more details.
I need exactly like your query as you mentionded above. But with small chagne, like
I want to compare two date fields by a dynamic soql. Query like :
CALENDAR_MONTH(CreatedDate) <=CALENDAR_MONTH(Time_Based_Mgmnt__r.End_Date__c)
It throws error like " expecting a colon, found 'CALENDAR_MONTH' " .
So please confirm me how to compare these two months. If i put the colon(:), getting another error " unexpected token: ( " . So please help me on resolving this bug.