+ Start a Discussion
rubel rana 6rubel rana 6 

Query in Date value

I want to  run a query to fetch some data from opportunity on based of start date. So,I wrote a query like this.

select Id,Name from Opportunity where Start_Date__c = 03/01/2024

But, it's showing error in query editor. What is wrong in this code? 
Thanks.

Best Answer chosen by rubel rana 6
CharuDuttCharuDutt
Hii Rubel 
Try Below Query 
select Id,Name,Start_Date__c from Opportunity where Start_Date__c = 2024-01-03
Please Mark It As Best Answer If It Helps
Thank You!

All Answers

CharuDuttCharuDutt
Hii Rubel 
Try Below Query 
select Id,Name,Start_Date__c from Opportunity where Start_Date__c = 2024-01-03
Please Mark It As Best Answer If It Helps
Thank You!
This was selected as the best answer
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rubel,

The format of the date should be as below.
 
SELECT Id, Start_Date__c FROM Opportunity where closedate =2021-12-27

If this solution helps, Please mark it as best answer.

Thanks,
 
rubel rana 6rubel rana 6
Thanks @charudutt and @sai praveen, it worked. :)