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

Abbreviating in Crystal Reports 1

Status
Not open for further replies.

12345ITguy

IS-IT--Management
May 24, 2011
5
NZ
Hi Guys,

I have a more difficult question than last time, I am wanting to abbreviate data in a crystal report using a formula, ie.

North
South West
South South West
East

Then in the report I would like it to display

N
SW
SSW
E

Any help is appreciated! :)

Thanks,
 
Provided you know all permutations. Then use a formula like

If Field = 'North' then 'N' else
If Field = 'South' then 'S' else
.....


Ian
 
If there are many combinations, you could use SPLIT to separate the words, UBOUND to count them and LEFT to get the first character.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Use a formula like this:

stringvar array x := split({table.field}," ");
numbervar i;
numbervar j := ubound(x);
stringvar y := "";
for i := 1 to j do(
y := y + x[1]
);
y

-LB
 
Thanks for the great tips, this forum is the best! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top