CF 2016 CFSQLTYPE CF_SQL_TIMESTAMP Failing After Leap Day (2/29)?
We have many queries which do something similar to:
WHERE dateCol > <CFQUERYPARAM VALUE="#someDateString#" CFSQLTYPE="CF_SQL_TIMESTAMP">
Today, users informed us that existing reports were returning unexpected results.
We use datetime2(7) columns in an MS SQL server.
As an example, we have data (3 rows) in a table with dateCol values of "2020-03-01 10:00:00.54321".
We run a query with a clause of:
WHERE dateCol > <CFQUERYPARAM VALUE="2020-03-01 10:00:00.54321" CFSQLTYPE="CF_SQL_TIMESTAMP">
These queries have been in place for years, and up until today they were working fine. The example query was returning 0 rows (as the timestamps were equal).
Today, the query is returning the 3 rows as if the converted value (from whatever CFSQLTYPE does internally) is earlier than 2020-03-01 10:00:00.54321.
Removing CFSQLTYPE="CF_SQL_TIMESTAMP" makes it work as expected. Running the query in SSMS without CFQUERYPARAMVALUE at all makes it work as expected. Adjusting the values on the row data or the string in the query by as little as .00001 in either direction works as expected, on a variety of data, so I don't think there's any issue with precision/rounding in implicit conversions.
Any ideas?
