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

Trim Function?

Status
Not open for further replies.

Noah114

Technical User
Mar 31, 2005
59
US
I have fields in a database the I wished shorten to a short name version. In other words:

Enbrel 25mg to Enbrel
Enbrel 50mg to Enbrel
Tracleer 50mg to Tracleer

Is their a function?
 
if there is always a space after the name you want, the something like:

SELECT MID(FIeldName, 1, Position(' ', FieldName))

I don't think I've got the syntax exactly right though...... should give you the idea though.

Leslie


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
This might work if all of your fields are formatted the same way: "DataYouWant [SPACE] DataYouDon'tWant"

Left([YourField], Instr([YourField], " "))

~Melagan
______
"It's never too late to become what you might have been.
 
InStr - that's the function I was trying to think of!! Pathetic how you forget the little things when you don't use them much!

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top