Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help parsing an E-mail address Post Reply Post New Topic
Author Message
icheckout
Newbie
Newbie


Joined: 18 Apr 2010
Location: United States
Online Status: Offline
Posts: 15
Quote icheckout Replybullet Topic: Help parsing an E-mail address
     Posted: 05 May 2010 at 9:47am

Thank you for looking at my post.

I am using Crystal 8 and have the following issue:

I have the e-mail address stored as one field. I need to break it down to be 4 fields for a report. Here is an example:

If the e-mail is:
 
 
I need to break it apart to the following 4 fields:
 
Jill      @      gmail      com
 
I have tried using STRINGVAR but have not been successful with the 4 formulas.
 
Could someone show me the 4 formulas to break up the e-mail address?
 
Thank you,
Richard Scott
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2010 at 10:12am

Jill... left({email},instr({email},'@')-1)

@...'@'

gmail... mid({email}, instr({email},'@')+1, instrrev({email},'.')-instr({email},'@')-1)

.com... right({email},length({email})-instrrev({email},'.'))

IP IP Logged
icheckout
Newbie
Newbie


Joined: 18 Apr 2010
Location: United States
Online Status: Offline
Posts: 15
Quote icheckout Replybullet Posted: 05 May 2010 at 11:11am
Thank you for the quick response. 
 
The formula worked fine for the Jill portion.  Unfortunately, since I have Crystal 8 it does not have the instrrev function that is used for the "gmail" and ".com" portion.
 
Do you know of a function I could use in 8 that would work like the instrrev? 
 
Thank you,
Richard Scott
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2010 at 11:14am
I do not.
If you always have .xxx then just replace it with 3.
e.g.

.com... right({email},3)

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2010 at 11:21am
IP IP Logged
icheckout
Newbie
Newbie


Joined: 18 Apr 2010
Location: United States
Online Status: Offline
Posts: 15
Quote icheckout Replybullet Posted: 05 May 2010 at 11:29am
DBlank,
 
Thanks so much.  All formulas worked just the way I needed.  I really appreciate you taking the time to help me.
 
Thanks,
Richard Scott
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum