Print Page | Close Window

Left function

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=10732
Printed Date: 27 Apr 2024 at 3:48am


Topic: Left function
Posted By: clumbsy
Subject: Left function
Date Posted: 04 Aug 2010 at 3:51am
I have a seven digit phone number in which I only want to pull the first three digits (prefix) I used this formula
 
Left({BI_CONSUMER_VIEW_1.BI_HOME_PHN}, 3)
 it gives me an error " A boolean is required here"
 
any suggestions?
 
Carmon



Replies:
Posted By: DBlank
Date Posted: 04 Aug 2010 at 3:55am

did you put this formula in the select expert? The seelct expert is only used to choose what data goes into the report.

You should create a formula field in the Field Explorer and use that same formula there.


Posted By: clumbsy
Date Posted: 04 Aug 2010 at 4:01am
Yes, I tried it in the select expert and within the selection formula section. Same results.


Posted By: DBlank
Date Posted: 04 Aug 2010 at 4:05am
The select expert is only used to select rows of data based on a T/F evaluation of each row of data  (hence the error expecting a boolean ...T/F).
In the Field Explorere there is the Formula FIelds section.
Right Click  on it and select New.
Name it whatever (e.g. area code)
use the same formula you had in there as the formula is fine assuming the phone number is a string.


Posted By: clumbsy
Date Posted: 04 Aug 2010 at 4:08am
Thank you,
It worked!
 
Clap



Print Page | Close Window