function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
juice2juice2 

Query on Date Field

I'm trying to use SOQL to query on CloseDates less than a particular time.

I'm using the following in my message:

Select AccountId, Name, StageName, Description, CloseDate, probability, amount, forecastCategory from Opportunity where CloseDate < '2004-04-01'

This does not work from me - I can run this same statement and do a search by Name or by forecast category but whenever i do anything with dates it does not work. I looked at the documentation and it seems that YYYY-MM-DD is acceptable. I'm a bit new at this so bare with me if i'm missing something.

Thanks

DevAngelDevAngel

Hi juice2,

Try removing the delimeters

"Select Id from Opportunity Where CloseDate < 2003-12-18"

juice2juice2

thanks -

I'll try that