I am trying to write to a sql table using Cold Fusion (which accepts sql statements). I have data passed from a form input field as varchar data. I use the following syntax to convert my variable: form.Amount into money format.
SELECT CONVERT(money, #form.Amount#) AS finalAmount
When I view the input variable (form.Amount) and the output variable (finalAmount) the input variable is the original format and the output variable is indeed in the money format. No errors are returned from the CONVERT sequence.
Yet, when I pass the variable finalAmount (money formatted) to the sql table, it returns the error, "cannot inplicitly convert data type varchar to money. Use CONVERT for the function." How do I get SQL to realize that in fact I have converted the data type into money?
Thanks
SELECT CONVERT(money, #form.Amount#) AS finalAmount
When I view the input variable (form.Amount) and the output variable (finalAmount) the input variable is the original format and the output variable is indeed in the money format. No errors are returned from the CONVERT sequence.
Yet, when I pass the variable finalAmount (money formatted) to the sql table, it returns the error, "cannot inplicitly convert data type varchar to money. Use CONVERT for the function." How do I get SQL to realize that in fact I have converted the data type into money?
Thanks