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!

How to remove characters 1

Status
Not open for further replies.

Goalie3533

Programmer
Apr 14, 2004
53
US
I need to create a formula that determines how many characters are in a string. If the string length is greater than 17, I need to remove all characters after the 17th and add to the string: "..."

So "Hello. How are you doing today?" would become "Hello. How are y..."

If the string length is less than 17, leave it alone.

How would I create this in crystal? Thanks in advance.

-Goalie35
 
Go to the field explorer, right click on formulae field, click new, name it say Shorter Text

If len({table.field})>17 then
left({table.field),17)+'...'
else
{table.field}

(use your field name for {table.field}

Cheers
Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top