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

To change the formatting for multiple text boxes at one time, hold the Shift key while clicking on each text box. Once they’ve all been selected, click on the desired formatting icon(s).

ADVERTISMENT