Salesforce - Proper date format for query

This is driving me effing nuts. What is the proper way to format a date filter for a query to Salesforce? Here is what I have and what I’m getting. I want to filter to only dates after October 1, 2024.

ETA - Yes, that screen grab has an extra y in the year spot, but even without that, it gives the same error.

According the the error project start date isn’t a date field in salesform. Can you confirm it is?

Yes. It is a date column in Salesforce.

you shouldn’t use parseDate()

you should use formatDate() in your filter.

Still no joy. I’ve tried getting this to run 6 ways to Sunday. Stupidest problem ever.


Here is the field in Salesforce. When you click that button, the calendar pops up. That tells me it is a date field lol
Screenshot 2024-11-07 160721

Solution: Use SOQL instead of the filter. It’s more of a pain in the rear, but it works. Here is what I ended up with that worked. Just change the Search By in the previously attached screen shots to SOQL and here is my query:

Select fields(all)
From Opportunity
where (Project_Start_Date__c > last_n_days:60 and Division__c = ‘Diving’) or (Project_Start_Date__c > last_n_days:60 and Division__c = ‘Pipeline’)

1 Like