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

coverting fields in coldfusion

Status
Not open for further replies.

bboult10

MIS
Joined
Nov 9, 2001
Messages
6
Location
CH
Hi,

I have been stuck on this problem for quite some time and I would love some help.

I am trying to update two different fields (field1 & field2) in a table using cfquery. Both fields should be updated from the same input field (field1_input). Field1 will update without a problem, however, field2 will not update because of a conversion problem.

field1 = text
field2 = char
field1_input = text

Here is my query:

update tbl_draft_detail
set field1='#field1_input#',
field2='#field1_input#'
where reference_number = #form.reference_number#


Both field1 and field2 types should can't be changed becasue of the way they should be displayed on the web.

Does anyone have any solutions?

Many thanks
 
what kind of "conversion problem"?

in 'field2 = char', does the 'char' means that you are entering numeric data? or it is varChar? or a memo?
if it's numeric, don't use single quotes in field2=#field1_input#...
Sylvano
dsylvano@hotmail.com
 
Field2 is varChar.

The coldfusion error is "Implicit conversion from datatype 'TEXT' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query."

I hope this helps



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top