I have to compare month value of a custom object's date field, if it is of the current month. Please find the piece of code below. I am getting error here. Can someone help me?
Code piece:
for(Call2_vod__c call: [SELECT Id,Account_vod__c, Call_Date_vod__c, Status_vod__c, Detailed_Products_vod__c, CreatedBy.Primary_Territory_vod__c
FROM Call2_vod__c
WHERE
Month(Call_Date_vod__c) = :today.Month()
and Detailed_Products_vod__c != null
and Detailed_Products_vod__c like 'SAMSCA%'
and Status_vod__c = 'Submitted_vod'
and Account_vod__c IN: hcpAccountmap.Values()])
Error displayed,
Error: Compile Error: Invalid aggregate function: Month at line 43 column 29