469,949 Members | 2,195 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

How to add 2 columns together

Mac
SQL2K
--------
I have 2 columns, one is numeric and 2nd is TEXT or memo column.

I have been trying for the last few days with no success.

Here is the statement that I have been using:
UPDATE MYTABLE
SET MYMEMO = STR(PERCENTAGE,7)+' '+MYMEMO

When I run it, I get data type error.

I would appreciate if someone please help me here.

Thx
Jul 23 '05 #1
1 4035
Hi,

Feedback below..

SELECT MAX(DATALENGTH(mymemo)) FROM mytable
-- If the above is < 8000
UPDATE MYTABLE
SET MYMEMO = RTRIM(LTRIM(STR(PERCENTAGE,7)))+' '+
CONVERT(VARCHAR(8000), MYMEMO)
GO
-- If it isn't < 8000 lookup UPDATETEXT clause in SQL Server BOL

Greg

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by John Small | last post: by
13 posts views Thread by scorpion53061 | last post: by
3 posts views Thread by Dave | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.