I found working with date literal, when working with the Infosphere SFDC Connector soql, to be counterintuitive for me. At least as I, normally, as I use SQL. I spent a little time running trials in Workbench, before I finally locked on to the ‘where clause’ criteria data pattern. So, here a quick example.
SOQL DATE String Literals Where Clause Rules
Basically, the date pattern is straight forward. The basic rules are for a soql where clause:
- No quotes
- No functions
- No Casting function, or casting for the where soql where clause to read.
Example SOQL DATE String Literals
So, here are a couple of date string literal examples in SQL:
- 1901-01-01
- 2016-01-31
- 9999-10-31
Example SQL with Date String Literal Where Clause
Select
t.id,
t.Name,
t.Target_Date__c,
t.User_Active__c
From Target_and_Segmentation__c t
where t.Target_Date__c > 2014-10-31
Related References
Salesforce Developer Documentation
Home, Developer Documentation, Force.com SOQL and SOSL Reference
Salesforce Workbench
Home, Technical Library, Workbench
Pingback: Salesforce – Useful Links | Scientia Compendium
Pingback: SFDC Salesforce Connector – Column Returns Null values, when SOQL Returns Data in Workbench | Scientia Compendium
Pingback: What does CRM Mean? | Scientia Compendium