House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

SQL concat

Author:
Cantrell, Adam
06/04/2003 02:19 PM

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. > 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. > > > > > 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 > > > > > > > > > > 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. > > > > > > >


Search cf-talk

May 24, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference