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

Pl help me "String"

Status
Not open for further replies.

ksraju6

Programmer
Jul 12, 2001
22
US
Hi,

Thanks in advance.


I need to join two fields and show them in one field from .

Eg: Name = Firstname + Lastname

But i want to keep all the digits of the firstname though there are spaces before concatinating the last name

I should see like this :John Sliger

Not like this :John Sliger


How can i Do that ?


Thanks

Raju
Sudhakark@keyusa.com
 
It depends on the database that you are using. If you have the names in char fields, that would be the default behavior. Since you are having problems, I will assume that they are in Varchars (which don't actually keep blanks at the end)

Let me first ask, is there a reason they need to be concatinated rather than printing as seperate fields and leaving CR to line them up?

But back to the question. If you know that the first name field is 20 characters, then you could have something like
Name = firstname+substring(spacestring20long,1,20-len(firstname))+lastname

Hope this helps

Peter Richardson
 
Thank U verymuch,

I really appreciate your help.


Raj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top