Guest_imported
New member
- Jan 1, 1970
- 0
When using an ole db, does coldfusion retrieve dates differently? What prompts this question is that I cannot get coldfusion to recognize a date in the WHERE section of SQL statement, when using an ole db. However, if I use an ODBC datasource, ColdFusion responds correctly and retrieves the record.
The variable that I use in the where section of the SQL statement is set equal to the present time using the now function, e.g., <cfset now = #now()#>
The SQL statement then makes use of that variable, e.g., <cfquery datasoure="Xxx" name="XXX">
SELECT *
FROM The TABLE
Where BeginDate >= #NOW#
</cfquery>
Again, the code I wrote returns records when the Datasource is an ODBC datasource, but returns an error when the Datasource is an OLE DB datasource. Thus, the question is why is this happening.
The variable that I use in the where section of the SQL statement is set equal to the present time using the now function, e.g., <cfset now = #now()#>
The SQL statement then makes use of that variable, e.g., <cfquery datasoure="Xxx" name="XXX">
SELECT *
FROM The TABLE
Where BeginDate >= #NOW#
</cfquery>
Again, the code I wrote returns records when the Datasource is an ODBC datasource, but returns an error when the Datasource is an OLE DB datasource. Thus, the question is why is this happening.