Yeh, that was it - I changed the datatype and now works fine. Thanks. Adam.
> -----Original Message----- > From: Ciliotta, Mario [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 04, 2003 1:24 PM > To: CF-Talk > Subject: RE: SQL concat > > > Adam, > > Here is a piece of the SQL 7.0 Books Online documentation > about concatenation: > > + (String Concatenation) (T-SQL) > An operator in a string expression that concatenates two or > more character or binary strings, columns, or a combination > of strings and column names into one expression (a string operator). > > Syntax > expression + expression > > Arguments > expression > Is any valid Microsoft(r) SQL Server(tm) expression of any of > the data types in the character and binary data type > category, except the image, ntext, or text data types. Both > expressions must be of the same data type, or one expression > must be able to be implicitly converted to the data type of > the other expression. > > It seems as though you cannot do it with a image, ntext or > text data type. > > Mario > > -----Original Message----- > From: Cantrell, Adam [mailto:[EMAIL PROTECTED] > Sent: 04 June 2003 19:15 > To: CF-Talk > Subject: RE: SQL concat > > > I've also tried: > > txt_description = {fn CONCAT(txtColumnName1, '#form.txtFieldName1#')} > > it gives a similar error. I guess you just can't concatenate > to this data > type? > > Adam. > > > > > -----Original Message----- > > From: Cantrell, Adam [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, June 04, 2003 1:09 PM > > To: CF-Talk > > Subject: RE: SQL concat > > > > > > They're the same type of data - the column data type is > > ntext. I've even > > tried this and still get "Invalid operator for data type. > > Operator equals > > add, type equals ntext": > > > > SET txtColumnName1 = Cast(txtColumnName1 AS ntext) + > > Cast('#form.txtFieldName1#' AS ntext) > > > > Adam. > > > > > > > > > -----Original Message----- > > > From: Ciliotta, Mario [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, June 04, 2003 12:26 PM > > > To: CF-Talk > > > Subject: RE: SQL concat > > > > > > > > > Hi, > > > > > > In a simple select query where the datatypes are the same you > > > can use this: > > > > > > SELECT (au_lname + ', ' + au_fname) AS Name > > > FROM authors > > > ORDER BY au_lname ASC, au_fname ASC > > > > > > > > > If the datatypes are different you need to use cast: > > > > > > SELECT 'The order date is ' + CAST(ord_date AS varchar(30)) > > > as display_date > > > FROM sales > > > WHERE ord_num = 'A2976' > > > ORDER BY ord_num > > > > > > > > > You can also use Convert() instead of Cast() > > > > > > Hope it helps, > > > Mario > > > > > > > > > > > > > > > -----Original Message----- > > > From: Cantrell, Adam [mailto:[EMAIL PROTECTED] > > > Sent: 04 June 2003 18:14 > > > To: CF-Talk > > > Subject: SQL concat > > > > > > > > > What's the operator for string concatenation in SQL server - > > > I'm trying: > > > > > > SET txtColumnName1 = txtColumnName1 + '#form.txtFormField1#' > > > > > > And that's throwing me an "Invalid operator for data type" error. > > > > > > Anyone help me out right quick? Adam. > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4