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

Joining a column with the column value + String 1

Status
Not open for further replies.

pmcd20

Technical User
Aug 4, 2015
2
IE
Example
When i have a column comment3' from the table 'TEST'

If i run, the string value n will get added to the start

one record resides in table
comment3 current value = 'pink'

UPDATE Test
SET comment3 = CONCAT('n',comment3)#

This returns = 'npink'

However i want it the other way. For the value 'n' to be at the end of the string.
I tried reversing the order of sql

SET comment3 = CONCAT(comment3,'n')#

The query ran but the 'n' did not add.

i also tried the comment3 = comment3 + 'n' /query ran but did not add
and then comment3 = 'n' + comment3 /query ran and was successful


Please can you assist how can add the string to the end of the this fields value

Thank you








 
The
Code:
SET comment3 = CONCAT(comment3,'n')#
should have worked. Did you get an error or did it not add the 'n'?
If you got an error, what error?
If it didn't add, what if you try:
Code:
SET comment3 = CONCAT(rtrim(comment3),'n')#
to make sure you are putting the 'n' at the end of the actual value in the comment3 field and not at the end of a space padded string.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
Thank you mirtheil

the rtrim did the trick. Thank you

The previous way that I was doing it did not give an error nor did it add the 'n'



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top