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!

Truncating filed from 30 or more to 30 less 2

Status
Not open for further replies.

Jimmy24

IS-IT--Management
Sep 7, 2006
21
US
Dear Sir or Madam,

I have a field called name that the length is 30, I have some names that a very long over 40. I need to truncate those names that has more than 30 caracters to make them 30. Would you please assist.

Thank you in advance

James

 
Use the LEFT function.

Ex:

[tt][blue]
Select Left(Name, 30) As NewName
From Table
[/blue][/tt]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Could you post some sample data. What do you want the names to look like after the update?

For exmple:

If the name is like this
Paul Frances Theriault jr

Do you want

P. F. Theriault

or just the first 30 characters?

- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top