|
Mailing Lists
|
Home / Groups / ColdFusion Talk (CF-Talk)
SQL concatI'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. > > > > > > > |
May 24, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||