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!

remove characters without knowing the length 1

Status
Not open for further replies.

mmasuda

Technical User
Dec 28, 2004
35
US
Hi,
Is it possible to create a query other than using the trim function to remove some unwanted characters from a string.
I have a delimiter in the middle of the string (#) and want everything removed following the delimiter. The number of characters before and after the delimiter vary.

Thank you,
MM
 
Hi!

Try this:

Left([YourField], InStr([YourField], "#") - 1)

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thanks for the quick reply.
I tried that but received an "invalid Procedure call" error. I added the following statement to the criteria option of the query: Left([insturl],InStr([insturl],"#")-1).

The SQL statement looks as follows:
SELECT tblinstitution.insturl
FROM tblinstitution
WHERE (((tblinstitution.insturl)=Left([insturl],InStr([insturl],"#")-1)));

Any help will be greatly appreciated.
Thanks,
MM
 
something like this (SQL code) ?
SELECT insturl, Left([insturl] & '',InStr([insturl] & '#','#')-1) AS TrimmedURL
FROM tblinstitution

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This worked wonderfully!
Thank you so much.

MM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top