Name in short

F

Frank Situmorang

Hello

I want to prepare a report which has name of members in short form

for example: Johannes Muda Hutauruk from First, Middle and Last Name. I
want to make a calculated field in the query to have it shown on the report:
like this : J. M. Hutauruk,

Can anyone help me how can I make it? Coz I tried to search the function of
Concatenate like in excel, but I can not find it.
 
R

Rob Parker

Frank Situmorang said:
Hello

I want to prepare a report which has name of members in short form

for example: Johannes Muda Hutauruk from First, Middle and Last Name. I
want to make a calculated field in the query to have it shown on the
report:
like this : J. M. Hutauruk,

Can anyone help me how can I make it? Coz I tried to search the function
of
Concatenate like in excel, but I can not find it.
 
R

Rob Parker

Hi Frank,

The simple way is a calculated field like this:
ShortName: Left([FirstName],1) & ". " & Left([MiddleName],1) & ". " &
[LastName]

However, this will give extraneous ". " characters if either FirstName or
MiddleName are null. You can avoid that by a slightly more complicated
expression:
ShortName: IIf(Not IsNull([FirstName]),Left([FirstName],1) & ". ") &
IIf(Not IsNull([MiddleName]),Left([MiddleName],1) & ". ") & [LastName]

HTH,

Rob
 
F

Frank Situmorang

Thanks Rob, you are very helpful to me.

--
H. Frank Situmorang


Rob Parker said:
Hi Frank,

The simple way is a calculated field like this:
ShortName: Left([FirstName],1) & ". " & Left([MiddleName],1) & ". " &
[LastName]

However, this will give extraneous ". " characters if either FirstName or
MiddleName are null. You can avoid that by a slightly more complicated
expression:
ShortName: IIf(Not IsNull([FirstName]),Left([FirstName],1) & ". ") &
IIf(Not IsNull([MiddleName]),Left([MiddleName],1) & ". ") & [LastName]

HTH,

Rob

Frank Situmorang said:
Hello

I want to prepare a report which has name of members in short form

for example: Johannes Muda Hutauruk from First, Middle and Last Name. I
want to make a calculated field in the query to have it shown on the
report:
like this : J. M. Hutauruk,

Can anyone help me how can I make it? Coz I tried to search the function
of
Concatenate like in excel, but I can not find it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top