Print Page | Close Window

Formula to display left text only

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=22902
Printed Date: 03 May 2024 at 11:43pm


Topic: Formula to display left text only
Posted By: amcapfixtures
Subject: Formula to display left text only
Date Posted: 30 Sep 2020 at 8:43am
Hi all, new to the forum. I'm using Crystal Reports 2013. I have a text string where I only want the left characters reported before the space between it and the remaining data. i.e. Carters 903216 and DT 903941 I only want Carters and DT returned. I have tried LEFT but it requires a number of characters and that varies. I much appreciate any help.



Replies:
Posted By: lockwelle
Date Posted: 02 Oct 2020 at 5:35am
left({table.field}, instr({table.field}, " ") - 1)


this way the number of characters is determined by where the first space is. I subtracted 1 character to remove the space.

HTH


Posted By: amcapfixtures
Date Posted: 02 Oct 2020 at 5:48am
Thank you very much!



Print Page | Close Window