Print Page | Close Window

Stripping an Email

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=23007
Printed Date: 28 Apr 2024 at 11:48pm


Topic: Stripping an Email
Posted By: Dejaneira
Subject: Stripping an Email
Date Posted: 16 Jun 2022 at 5:41am
Is there a way to write a formula that can strip '@company.xxx'? I want to delete the @ and everything after but the emails are not consistent. Is this possible?



Replies:
Posted By: lockwelle
Date Posted: 16 Jun 2022 at 5:52am
you want something like:
left({table.field}, instr({table.field}, "@") - 1)

I don't have Crystal right now, so I might have the wrong command for instr.

What the above is trying to do is to take everything from the left of the email as judged from where @ character is. Subtract 1 to remove the @ character. This will leave everything to left of the @ regardless of where the @ is in the email.

HTH



Print Page | Close Window