Feedback
Did this article resolve your question/issue?

   

Article

Error when processing a query with Date Literals from Salesforce ODBC Driver

Information

 
TitleError when processing a query with Date Literals from Salesforce ODBC Driver
URL Nameerror-when-processing-a-query-with-date-literals-from-salesforce-odbc-driver
Article Number000136611
EnvironmentProduct : Progress DataDirect for ODBC for Salesforce Driver
Version : 8.0
OS : All supported platforms
Database : Salesforce
Application : All supported applications
Question/Problem Description

Syntax error when processing a query with Date Literals from Salesforce ODBC Driver

Steps to ReproduceExecute the following query after connecting to Salesforce using Progress DataDirect for ODBC for Salesforce Driver 

Select ACCOUNTID from OPPORTUNITY where CLOSEDATE = YESTERDAY

Below error message is received.
Clarifying Information
Error Message[DataDirect][ODBC Salesforce driver][Salesforce]syntax error or access rule violation: column not found: YESTERDAY
Defect Number
Enhancement Number
Cause
The Date Literals used are (SOQL) Salesforce Object Query Language functions.
Resolution
When using SQL, the SQL date math functions supported by ODBC should be used.

For Example:
TOMORROW -> DATEADD(DAY, 1, TODAY) 
YESTERDAY -> DATEADD(DAY, -1, TODAY)
Workaround
Notes
References to other documentation:
Progress DataDirect for ODBC for Salesforce Driver 8.0, Reference, ODBC API and Scalar Functions, Scalar Functions, Date and Time Functions
https://documentation.progress.com/output/DataDirect/odbcsalesforcehelp/index.html#page/odbcsalesforce%2Fdate-and-time-functions.html%23

Salesforce Documentation
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Last Modified Date8/22/2019 7:24 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.