updating a field  
Author Message
Dick80813





PostPosted: Wed Oct 10 11:24:06 PDT 2007 Top

SQL Server >> updating a field

I would like to update a field with the contents of itself plus another 1
other field....something like this...

set fieldx=fieldx + fieldy

it keeps adding the two values, where
i would like to see both values in fieldx

SQL Server172  
 
 
Andrew





PostPosted: Wed Oct 10 11:24:06 PDT 2007 Top

SQL Server >> updating a field Perhaps using a cast statement to treat the contents explicitly as a text
datatype?



>I would like to update a field with the contents of itself plus another 1
> other field....something like this...
>
> set fieldx=fieldx + fieldy
>
> it keeps adding the two values, where
> i would like to see both values in fieldx

 
 
David





PostPosted: Wed Oct 10 11:25:56 PDT 2007 Top

SQL Server >> updating a field

>I would like to update a field with the contents of itself plus another 1
> other field....something like this...
>
> set fieldx=fieldx + fieldy
>
> it keeps adding the two values, where
> i would like to see both values in fieldx

What are the datatypes of the two columns? Concatenation only works for
strings.

--
David Portas