Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to trim name form Email address field 2

Status
Not open for further replies.

urbanhim

MIS
Jul 11, 2007
154
GB
Hi, i've done a search, i'm sure its on here but have spent a while looking but cant find anything.

I have an email field, which i need to trim to show only before the "@" :

So for example:

my_name@domain.com

should return just:

my_name

Thank you



UrbanHim
Crystal XI Report Writer
London
[shadeshappy]
[small]What's good for a hangover?... Heavy drinking the night before!![/small]
 
Use split

//{@name}:
stringvar array x := split({table.emailfield},"@");
x[1]
 
Blimey, that was quick! Thanks so much, has worked a treat!

UrbanHim
Crystal XI Report Writer
London
[shadeshappy]
[small]What's good for a hangover?... Heavy drinking the night before!![/small]
 
Not very busy today. Waiting for client to get test enviroment up and running!

Sitting in sunny Bournemouth looking at the lovely weather outside.

Ian
 
Very nice too! Even the sun can't lift the grime off of South London which is where our office is based! Very depressing, and you can bet your bottom dollar that come the weekend, it will be raining! ;-)



UrbanHim
Crystal XI Report Writer
London
[shadeshappy]
[small]What's good for a hangover?... Heavy drinking the night before!![/small]
 
Another way is:

extractstring({table.email},'',@)

You could even include as part of it a replacement for the underscore and case handling:

propercase(replace(extractstring({table.email},'',@),'_',' '))

john_smith@domain.com
becomes
John Smith

P.s. - Weather here is still poor :/

'J

CR8.5 / CRXI - Discovering the impossible
 
Thanks for that, very useful too! At some point we want to get firstname and surname so your formula will be very useful for that! Cheers!


UrbanHim
Crystal XI Report Writer
London
[shadeshappy]
[small]What's good for a hangover?... Heavy drinking the night before!![/small]
 
Yw - btw:

//Firstname
extractstring({email.field},'','_')
//Surname
extractstring({email.field},'_','@')

Is pretty crude but should do the trick.

I will be down your way sometime soon Ian - One of our offices is based in Poole.

'J

CR8.5 / CRXI - Discovering the impossible
 
Don't actually live in Bournemouth, my client is based there. Currently only there 3 days a week. Today I am with another client in Brighton which is nearer to where I live.

On the coast about half way between Brighton and Eastbourne.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top