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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CF ERROR MESSAGE

Status
Not open for further replies.

kingjjx

Programmer
Sep 18, 2001
181
US
Hi, can some one tell me what this error message means ??
I have a field in my table called amount which is set to data type 'money'
I created a form to insert values to that table and its giving me this error ::


Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion from data type varchar to data type money, table 'DynoOwnerRec.dbo.TuningLinkIssues', column 'Amount'. Use the CONVERT function to run this query.



The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (1:1) to (1:51).


ANY IDEAS ???
 
You need to make sure that the datatype of the field in table 1 is the same as the datatype of the field in table 2. Otherwise, you need to convert the data.

Glad you solved the other issue. Is this problem part of the same process?
 
yes, this is the same process.
if you wanna look at what im trying to do:

(type in: advance)


HOW DO I CONVERT DATA ????

Im not even carrying data over from the other table with the field that I am having problem with. Basically, I just put value= "" in the form so the user can enter the info.

you'll have a better understanding if you check out that link ...

please help.
thanks
 
If you look at the error, it cannot convert the datatype varchar to datatype money. What is the datatype of your form field? Try making it numeric (maybe prepopulate with a 0 if that is appropriate) and, if it is a cfinput you can validate a numeric data type.

Then, in your insert/update query, there should not be any quotes around the form field name, as it is numeric. If you are using CFINPUT/CFUPDATE it will take care of this for you (if you have the correct data type specified in the form field).

The CONVERT functionality is a scalar, not CF, function. You need to look at the SQL Server documentation for that one (been a while since I used it); scalars are built into the query, so the conversion process takes place there. You will need to use cfquery rather than cfinsert or cfupdate to run scalars, I believe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top