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

Supressing Data after a Comma 1

Status
Not open for further replies.

ltkling

Technical User
Jan 26, 2010
7
US
I have a field that returns data separated by a comma and I only want to see the data that precedes the comma.
Thanks
 
I can only think of using the instr function to find the comma, then use the left function to just return that part of the string. Example:
left({string},instr({string},",")-1). If there is not a comma in the string, it will return an error.
 
left({@string},len({@string})-1)

Instr() would only check for the first comma in the string.

-LB
 
Instr() would only check for the first comma in the string."

I believe that is what Itkling is looking for.
 
Kray4660 - That is what I am looking for however, there are some results from that field that don't have a comma and are text only...when I use this formula, I get nothing in that field.
 
add a 'no comma' check to the beginning of your formula:

IF instr({string},",")=0
then {string}
else
left({string},instr({string},",")-1)
 
Thank you all for your help!!! This last one worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top