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

Remove data from a String 1

Status
Not open for further replies.

YANKRAY

Technical User
Nov 7, 2003
283
Using CR 10.0

I have a field with part numbers of various lengths.

Some of the Part numbers end with -EA.

I need to be able to remove the -EA from those that have it and leave the remaining part number.

Examples:

Field contains;

12345
1467
5678-EA
89-EA

Result should look like;
12345
1467
5678
89

Thanks,
Ray
 
i do not have crytsal in front of me right now, but perhaps something like this:

IF RIGHT({Table.Field},3)="-EA"
then LEFT({Table.Field},LEN({Table.Field}-3))
 
Or use the following instead of the partno field:

replace({table.partno},"-EA","")

-LB
 
Fisher - Your solution gave me a "must be a number" error from Crystal.

LB - Your solution was exactly what I needed.

Thanks for the support.

Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top