Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add two text fields?

Status
Not open for further replies.

PureNSimple

Programmer
Oct 2, 1998
13
0
0
US
I have in my table two TEXT fields. I want to add them. I have used '+' and '¦¦' operators but they give error. They work however with varchar and char fields. Just tell me how to add two TEXT fields? I cant convert them into varchar or char since they will get their data lost.
 
Just an idea:<br>
<br>
SELECT Text1 & Text2 Into Dest From Source<br>
<br>
HTH.
 
Salam (Hi)<br>
No. It does not work. Anyway thanks for your suggestion.<br>

 
It doesn't appear that this can be done in Version 6.5....I went to a Microsoft sponsored meeting last night and they said that 7.0 should support this. (They weren't sure)....The beta 3 is available now, it would probably be worth looking at.<br>
<br>
Until then, I'm not sure of your application, but would it be possible for you to manipulate the text fields separately and then just output them together? Or do you need to store them concatenated?<br>
<br>
If you are using your database in a separate language environment, like a Visual Basic application, you could try selecting the fields into variables, adding them and then inserting the result into a new table or back into one of your old fields. I hope this helps. If not, please give me more detail as to your programming environment and we may be able to work out a solution.<br>
<br>
Doug
 
AssalamOAlaikum (Hi)<br>
Thanks for your help. Whatever you have said is very helpful to me.<br>
Thanks.<br>
Pure
 
What do you want to do with them after you add them?<br>
Try - select a + b as c from myTable<br>
or - select a & b as c from myTable
 
why dont u check out UPDATETEXT.. u will have to work with pointers though... This works in SQL 2000..
 
Hi Phili5678

You think I am still waiting for the solution even after 2 years? Man you must be kidding. right? :) thanks anyway.

Pure
 
Well phili5678,
This was exactly what I needed another year later yet. Thanks, the
Code:
select a + b as c from myTable
works perfectly.

Thanks,
Ursula
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top