Salesforce Fact #2 | Date check SOQL
If we want to
extract the day from a date/time field, we can use the DAY_ONLY
function. Suppose, if I want to get the accounts which were created on
1st Jan,2021 we can use the below query:
SELECT Name FROM Account WHERE Day_Only(CreatedDate) = 2021-01-01 i.e. (YYYY-MM-DD)
Note: we need not enclose the input date inside quotes.
Comments
Post a Comment