BOFocus – Crystal Reports Tips – Tricks – Tutorials

Crystal Reports - Formulas

Display a person’s full name and title correctly

if you happen to have a database where the columns/fields separate our a person’s name into individual fields, the following formula will put them together into a single string.

StringVar Name;

If Isnull({Middle_Initial}) Then
Name := TrimLeft({Last_Name}) & “, ” &
TrimLeft({First_Name}) Else

Name := TrimLeft({Last_Name}) & “, ” &
TrimLeft({First_Name}) & ” ” &
TrimLeft({Middle_Initial});

If Not Isnull({Title}) Then
Name & “, ” & {Title} Else
Name;

Tagged ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

GET SOCIAL

QUICK TIP

When in the formula editor, Start out by typing the first charter of the function, press Ctrl-Space. The keyword auto complete will than show a list of the functions available beginning with the charter you typed in.

ADVERTISMENT