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

Text Issues 2

Status
Not open for further replies.

MikeCitizens

Technical User
Aug 13, 2002
37
US
Hello,

I have a large text field that hold three major peices of information.

Here is an example of what is in this field:

Source Reference: 040303004902 Customer Name: Michael Technologies Inc Debit Account: 3305052327

Now I know how to pull out the reference number and the account number from this using the left and right strings

Now normally i would know how to pull out the customer name also, however it is never the same number of characters

Is there any way to strip off the first 45 chacraters of a field and the last 25 characters leaving the rest?

Mike
 
You might be able to use something like this:

Mid({field}, 46, (length(field)- 70))

The "70" comes from 45 + 25, so your subtracting the number of characters you don't want from the length of the field to get the number of characters that you do want.

-D
 
This didn't work. I recieved an error that it was looking for another ).

Im able to pull the Reference number out using

Mid(totext{field}), 19, 12)

and Im able to pull out the account number using

Right({field}, 10)

Is there a way to have the formula pull everything between the 45 charcter from the left and the 25 character from the right??

MIke
 
Hi !

Maybe this can help you:

numbervar pos2 := instr({field},'Debit Account');
numbervar pos1 := instr({field},'Customer Name:') +15 ;

mid(test,pos1, pos2 - pos1);

/Goran
 
Hello,

Thanks your help on this, both of you.
I was able to figure this out
I need to create two formulas

#1

mid({field}, 46)

#2

left({formula #1 field}, len{formula #1 field} & "") -25)


Again thanks for you're help and I hope this thread helps others

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top