• nacy kelly
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Requirement: I want to search Opportunity records based on closed date from the VF page. How to pass the date field to dynamic string query in apex?
I am getting below error.

Error:
unexpected token: '2021-03-01'

Please advise how to resolve this error.
sample code below:
---------------------------
if(closedDate != Null ){
                strFilter += 'AND Close_Date__c ='+closedDate;
  }