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!

TRIMMING FROM A SPECIFIED CHARACTER ONWARDS 1

Status
Not open for further replies.

ovie52

Technical User
Feb 5, 2002
11
0
0
GB
I HAVE ENTRIES IN A FIELD IN A TABLE SUCH AS:

5100V#74853769376
4100#8957984768745
5180#89745967

I WANT TO TRIM THEM FROM THE '#' ONWARDS. I.E. SO THEY READ
5100V
4100
5180

CAN ANYONE HELP?
 
try this expression:

left([myStr], instr(1,[myStr],"#",1) -1))

this assumes that there will always be a "#" Best Regards,
Mike
 
Or does it require:

Right([Mystr],Len([Mystr])-Instr(1,[Mystr],"#"))

which will produce
74853769376
8957984768745
89745967
in the above example Sandy
 
Oops,
should read more carefully- sorry about that Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top