How to Filter Salesforce Data by Date Field with Custom SQL
Published: 02 Oct 2023 Last Modified Date: 03 Oct 2023
Question
How can we filter Salesforce data by a date field with custom SQL?
Environment
Tableau Desktop
Salesforce.com
Answer
When connecting to Salesforce data with custom SQL, you need to write a SOQL compliant query. You can specify date values or date literals in the WHERE clauses to filter SOQL query results referring to Date Formats and Date Literals in WHERE.
Example:
SELECT CaseNumber, CreatedDate FROM Case WHERE CreatedDate > 2023-01-01T00:00:00Z
Additional Information
For more information on the Salesforce Object Query Language (SOQL), view Salesforce Help.