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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatanate

Status
Not open for further replies.

bugzLue

IS-IT--Management
Feb 27, 2001
57
US
I have a Auto number that I want to concatanate this text
I have tried this code but it will not work. please help.

this was
SELECT
(id(cast id as char)+' '+species+' '+genera+' '+cultiver)

From plants

AND THIS WAY
I get the text to concatanate

SELECT
Cast (id as CHAR) ID, (species+' '+genera+' '+cultiver)

From plants Live to learn or die trying
 

Try this ;

SELECT
(CAST(ID as char)+' '+species+' '+genera+' '+cultiver) as Text From plants



Muhammad Essa Mughal
Software Engineer
essamughal@yahoo.com
 
Thanks for your help.

That put all of it in one column, I get the number now but the text is only showing up as dots

1 ...
3 ...

thanks for again for your help Live to learn or die trying
 

Dear ;

If species , genera and cultiver columns of table Plants and they also have data in them then following query must give the result.

SELECT
(CAST(ID as varchar)+' '+species+' '+genera+' '+cultiver) as ResultedText From plants


I think you are viewing results in grid form , select text from the Query Menu and then you can see the whole row instead of results in a grid. In grid format you will have to extend the grid column width to view the complete row.

Above query was also giving results but due to short width u can not view them. May be I am wrong.


If species , genera and cultiver are not columns and just simple text to concotenate with ID then it is simple to have result in this way

SELECT
(CAST(ID as varchar)+'species genera cultiver') as ResultedText From plants

Please , clear my confusion if you still don't get solution.



Muhammad Essa Mughal
Software Engineer
essamughal@yahoo.com
 
Thank you you are right it is working now.
again thank you for your time and help Live to learn or die trying
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top