Concatenate person's name and initials

glawson

Registered User.
Local time
Today, 10:17
Joined
Jul 18, 2013
Messages
14
Hi,

I'm after some help to concatenate a number of fields from a table into a query please.

The fields are:

Prefix
Firstname
MiddleInitial
MiddleInitial2
MiddleInitial3
Surname

Note that there will be varying combinations: some people will have a Prefix, Firstname then surname (no middle initials), so I would want to display "Mr Joe Bloggs". But others could have no Prefix but two middle initials, so "Joe P J Bloggs".

I've a rough idea, but need help with the actual string.

Thanks
 
You would do something like this:

DisplayName: Prefix & iif(isnull(Firstname)=false, Firstname & " ") & iif(isnull(MiddleInitial)=false, MiddleInitial & " ")

Keep adding fields in the manner i added Firstname and MiddleInitial

Also, there's probably no reason to have multiple MiddleInitial Fields. You could just jam them all into the field called MiddleInitial. It's not like you will be querying people who have a 2nd middle initial of J.
 
Thanks very much... it works a treat!
 

Users who are viewing this thread

Back
Top Bottom