Can you confirm that the cfsqltype "decimal" is no...
# adobe
d
Can you confirm that the cfsqltype "decimal" is not accurate enough to match the mssql type "money"? https://cfdocs.org/cfsqltype-cheatsheet lists to use decimal for money, and https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-p-q/cfqueryparam.html does not list a cfsqltype for money. 😞 With a mssql column type of MONEY and cfsqltype="cf_sql_decimal" this
66.50
is saved as
67.00
- notice the rounding up. Ofcourse, cfsqltype="cf_sql_money" works as expected.
t
this is a stupid behavior of cfqueryparam...with decimal, oyu need to specify scale. If you don't scale defautls to 0
👍 1
d
define scale in the queryparam?
t
so you need
cfsqltype="cf_sql_decimal" scale="2"
d
ah
t
i cannot count the number of times i've been bit by this.
d
ok got it. thank you so listing money for cf_sql_decimal is appropriate. I had a feeling I was missing something.
s
have you tried
cf_sql_numeric
d
Numeric like decimal requires the scale option for my required precision. So I chose money which is describes the exact same type in sql