Calculation for Shortening Middle Name to First Letter

Question asked by Katie on Apr 5, 2013
Latest reply on Apr 5, 2013 by Katie

Title

Calculation for Shortening Middle Name to First Letter

Post

I know how to combine First, Middle and Last name fields into one field using a calculation, but is there a way to input only the first initial of the person's middle name (even if there is a full middle name in the middle name field).

For example, if I have the following fields:

First: John

Middle: Joseph

Last: Smith

And I wanted to combine them to read:

"Smith, John J." (instead of "Smith, John Joseph")

How would I do that?  Also, do you recommend using the Trim function in these types of calculations?  Where would I place that?

I have included my calculation for combining the three full names into "First Middle Last" below so you can see what my exact field and table names are.

If ( not IsEmpty ( Contacts::First ) ; Contacts::First & " ") & If ( not IsEmpty ( Contacts::Middle ) ; Contacts::Middle & " " ) & Contacts::Last