I'm getting below error when i try WHERE clause (SOSQL) greater than equal. any idea how to fix this?
First off - this should be a YYYY-MM-DD expression if it accepts a Date. If not - you made need to include a time using this format:
see the SOQL instructions here:
Thanks. the link you shared has helpful tips. the problem is the close_date_c field comes in the format shown below, how'd i fix that?
CreatedDate | Close_Date__c |
3/2/2021 20:08 | 1/30/2023 |
6/29/2020 20:15 | 1/31/2023 |
What happens when you put 2023-01-30 in your where clause? can you confirm that this field is a date in Salesforce (ie in field/relationships) under the Object?
When I tested this on a datetime field I used:
SELECT
LastModifiedDate
FROM
Account
WHERE
IsDeleted=False and LastModifiedDate>=2022-01-08T01:02:03Z
and this worked fine.
I have also confirmed that for a date field the format of 2022-01-01 is proper - and if you validate your query it will tell you that. Can you confirm your datefield is a date - and not a string? My suspicion is that you field in Salesforce is a string. In this case you would use todate(Close Date,dd/mm/yyyy)
assuming these are strings - and not date at the Salesforce field level - you may want to have a "talk" with your Salesforce implementation team/consultant.
the dd/mm/yyyy may need to be in quotes - validate query will tell you.
Can you mark this is a correct solution?