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!

Formula for names 4

Status
Not open for further replies.

Crystalamateur

Technical User
Jul 27, 2005
19
GB
Hi there,

I am new to Crystal and am struggling with a formula, the formula is as follows:

trimleft ({title} + ' ' + {initials} + ' ' + {surname})

The problem is if there is a title but no initials (or visa versa) then the report has no data showing.

Any help/suggestions would be appreciated.

Thanks
Peter
 
do a formula field for intials, if isnull({initials}) then "" else {initials}. Use this in place of {initials}.
Nulls stop any crystal formula, unless tested for.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi there,


whileprintingrecords;

stringvar title;
stringvar initial;
stringvar sname;
stringvar disp;

if isnull({Title.Field}) or {Title.Field} = "" then title:= "" else title:= {Title.Field} + " ";

if isnull({Initial.Field}) or {Initial.Field} = "" then Initial:= "" else Initial:= {Initial.Field};

if isnull({Sname.Field}) or {Sname.Field} = "" then sname:= "" else sname:= {Sname.Field};

disp:= title + initial + sname

HTH
 
Hi there, many thanks for your reply to my query.

Your suggestion is great.

many thanks
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top