Showing posts with label memo. Show all posts
Showing posts with label memo. Show all posts

Friday, February 24, 2012

how to add 2 memo fields

I have memo1 field. It has some data. I want to add another memo field
which is memo2 at the end of the memo1 after leaving couple of spaces.
I tried following but it does not work.
update test
set memo1 = memo1+' '+memo2
Can someone please help me to merge/add 2 memo fields ?
ThanksWhat are the data types for your memo columns? When you say
it doesn't work, what error do you get or what results do
you get that seem incorrect.
You should also post the DDL for your table as that helps in
addressing issues such as these.
-Sue
On Wed, 09 Mar 2005 16:41:40 GMT, "Mac" <mac@.hotmail.com>
wrote:

>I have memo1 field. It has some data. I want to add another memo field
>which is memo2 at the end of the memo1 after leaving couple of spaces.
>I tried following but it does not work.
>update test
>set memo1 = memo1+' '+memo2
>
>Can someone please help me to merge/add 2 memo fields ?
>
>Thanks
>

how to add 2 memo fields

I have memo1 field. It has some data. I want to add another memo field
which is memo2 at the end of the memo1 after leaving couple of spaces.
I tried following but it does not work.
update test
set memo1 = memo1+' '+memo2
Can someone please help me to merge/add 2 memo fields ?
Thanks
What are the data types for your memo columns? When you say
it doesn't work, what error do you get or what results do
you get that seem incorrect.
You should also post the DDL for your table as that helps in
addressing issues such as these.
-Sue
On Wed, 09 Mar 2005 16:41:40 GMT, "Mac" <mac@.hotmail.com>
wrote:

>I have memo1 field. It has some data. I want to add another memo field
>which is memo2 at the end of the memo1 after leaving couple of spaces.
>I tried following but it does not work.
>update test
>set memo1 = memo1+' '+memo2
>
>Can someone please help me to merge/add 2 memo fields ?
>
>Thanks
>

how to add 2 memo fields

I have memo1 field. It has some data. I want to add another memo field
which is memo2 at the end of the memo1 after leaving couple of spaces.
I tried following but it does not work.
update test
set memo1 = memo1+' '+memo2
Can someone please help me to merge/add 2 memo fields ?
ThanksWhat are the data types for your memo columns? When you say
it doesn't work, what error do you get or what results do
you get that seem incorrect.
You should also post the DDL for your table as that helps in
addressing issues such as these.
-Sue
On Wed, 09 Mar 2005 16:41:40 GMT, "Mac" <mac@.hotmail.com>
wrote:
>I have memo1 field. It has some data. I want to add another memo field
>which is memo2 at the end of the memo1 after leaving couple of spaces.
>I tried following but it does not work.
>update test
>set memo1 = memo1+' '+memo2
>
>Can someone please help me to merge/add 2 memo fields ?
>
>Thanks
>

How to add 2 columns together

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
Hi,
You need to convert the TEXT data type to Varchar for using normal updates.
UPDATE MYTABLE
SET MYMEMO = ltrim(rtrim(convert(char,PERCENTAGE,7)))+'
'+ltrim(rtrim(convert(varchar(8000),MYMEMO)))
Thanks
Hari
SQL Server MVP
"Mac" wrote:

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

How to add 2 columns together

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.
ThxHi,
You need to convert the TEXT data type to Varchar for using normal updates.
UPDATE MYTABLE
SET MYMEMO = ltrim(rtrim(convert(char,PERCENTAGE,7)))+'
'+ltrim(rtrim(convert(varchar(8000),MYMEMO)))
Thanks
Hari
SQL Server MVP
"Mac" wrote:
> 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
>
>|||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

How to add 2 columns together

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.

ThxHi,

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

How to add 2 columns together

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.
ThxHi,
You need to convert the TEXT data type to Varchar for using normal updates.
UPDATE MYTABLE
SET MYMEMO = ltrim(rtrim(convert(char,PERCENTAGE,7)))
+'
'+ltrim(rtrim(convert(varchar(8000),MYME
MO)))
Thanks
Hari
SQL Server MVP
"Mac" wrote:

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