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!

Truncate Text after Date String 1

Status
Not open for further replies.

dunkyn

Technical User
Apr 30, 2001
194
US
I need to build a formula which find the date string and then truncates any remaing text.

Example:

DOW CAPITAL B.V.GTD NOTES 7.1250% 01/15/2003(BK ENTRY)

Would then read as

DOW CAPITAL B.V. GTD NOTES 7.1250% 01/15/2003


Also, any tips on how to remove the excess 0 in 7.1250% would be appreciated.

Thx every so much. This is all new to me.


 
Is this all one field to begin with? If so, it's an odd way of managing information.

A population of one as a sampling requires a leap of faith, but try the following in a formula for creating the same text less everything past the date and eliminating any 0%:

replace(left({table.stringfield}, instr({table.stringfield}, "(" )-1),"0%","%")

-k
 
Yes, this is all one field. It comes from an explanation text field.

I'll take a look at your recommendations.

Thx.
 
With the formula:

replace(left({cotting txns.Explanation},instr({cotting txns.Explanation},"(" )-1),"0%","%")

I get the message

'string length is less than 0 or not an integer'

 
That is because of the instr function. Most likely the "(" isn't always in your field.

Try this one instead. I'm assuming that you will have a "/" in the field.

replace(left({@field},instrrev({@field},"/")+4),"0%","%") Mike
 
THANKS. VERY HELPFUL.

I highlighted instrrev and hit F1, but it just brought up the formula editor. What does "instrrev" stand for?

Again, many thanks.
 
In String Reverse.

It checks the first occurance of a string starting from the right hand side of the string and returns its position counting from the left. Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top