I am having a weird issue with using the cfqueryparam tag with a float cfsqltype. I am querying a SQL Server 2022 database and I have tried on Lucee versions 6.2.4.24 & 6.2.6.19 with the Microsoft SQL Serve application 13.2.1 version installed.
The issue I am having is that I have table (table1) with a float field (field1) where the value is 2.01 and when I attempt the following query there is no results returned:
SELECT *
FROM table1
WHERE field1 =
I was using a variable in place of ‘2.01’ that had that value but to remove the possibility of it being an issue with the variable I just replaced it with the number and still didn’t get any results. If I were to replace that = with >= the record would show in the result, so it appears that queryparam value somehow is translated as a number larger than 2.01.
If I remove the cfqueryparam tag wrapper then I do get a result. I am sure this probably has something to do with how floating point numbers work/are stored and why you will get numbers with a bunch of 0’s after the decimal and a number at the end when performing mathematical functions on them.