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

how to show only part of the info

Status
Not open for further replies.

demkalt

Technical User
Oct 30, 2001
7
NL
Hello,

I had found an formula to show, say fgh0012345 instead
of fgh000000000012345 , but i lost it and can't seem
to find it. Does anyone know the formula for this ??

Thnx in advance.

demkalt
 
This will depend on the format of your source field. If it will always be:

XXXnnnnnnnnnnnnnnn // XXX being Char, nnnn being numeric

then how about:

Code:
left(field,3) + "00" + ToText( ToNumber(right (field,15)),0,"")

This formula combines the following:
a) The first three characters
b) "00"
c) The numeric value held in the last 15 chars

We have to mess around with part c) as we convert it from text to a number, then back to text. We also need to ensure we don't get the decimal places and thousand separator (that's what the ',0,""' bit is for).

Hope this helps

Steve Phillips, Crystal Consultant
 
thanx very much, i will try this, I think this
was the correct formula.

DemKalt
 
Or to make it more general, Have parameters called
{?srchStr} and {?replStr}

*************** formula start **************
StringVar result;

result := replace({table.strValue},{?srchStr},{?replStr})

result;

*************** formula start **************

then the string could be anywhere and controlled through input

Jim
 
Hi,

or to make it more simple just use...

left({field},3)+right({field},7)

Hth,
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top