Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing varchar to money data type

Status
Not open for further replies.

leardvr

MIS
Feb 16, 2001
3
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top