×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

@Name question

@Name question

@Name question

(OP)
Hi all.

I have an application that welcomes the user by using their first name in a welcome message. I use the following formula to extract their first name from their username:

@Left(@Name([CN];@Username);" ")

The problem I have now is that someone has joined our company with a two word firstname. Now the formula only returns the first word of her firstname which she does not like. I have been able to manipulate the formula to return both words of her first name but then this does not work for everyone else.

I've tried using @Name([G];@Username) which according to designer help will return the "given" name but it doesn't seem to work.

Anyone with any ideas?

Thanks!

RE: @Name question

Hi

what about @Name([CN]; @UserName)?

Regards

Stephan

RE: @Name question

(OP)
That will give me the Common Name (CN) ie firstname / initial / last name of the user name. It strips of the hierarchical infomation

I only want the first name.

As you can see in my formula I'm getting the common name and taking everything to the left of the first space. This works fine for people who only have one word in their firstname. If someone has two words (like Sue Ann) this does not work. In this case you would get Sue. I'm trying to find a way of coping with the two different senarios.

Cheers!

RE: @Name question

Instead of @left, use @leftback. Supposing that nobody has two last names seperated by a space, that means that @leftback will get the first space from the right, and take everything to the left of that.

Pascal.

RE: @Name question

(OP)
Thanks Pascal, your sugestion went part of the way but has prompted me how to solve the issue.

Because we use the middle initial in our user names I had to do a double take using the @LeftBack to get past 2 spaces using the following:

fname:=@LeftBack(@Name([CN];@UserName);" ");
@LeftBack(fname;" ")

Funny, sometime you can't see the wood for the trees!!

Cheers!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close