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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula error"The result of selection formula must be boolean"

Status
Not open for further replies.

dfwcharles

Technical User
Apr 10, 2002
36
US
I tried this formula, and got the error listed above.

if Length({equipment.eqnum}) = 9
then
left ({equipment.eqnum},3)
else
left({equipment.eqnum},4)

I just want to show the frist 3 characters of my field if the data length is 9. Otherwise show the frist 4 characters.
Any help would be appreciated.
Thanks
 
IF Length({equipment.eqnum})= 9 THEN left({equipment.eqnum},3)
ELSE left({equipment.eqnum},4)

It works fine for me....
 
Crystal thinks the formula is a boolian, one-bit, true or false. I've had this before in Crystal 8.5 and found the easiest solution was to re-do the code in a new formula field. If there's a cleverer answer, I'd be interested to hear it.

Madawc Williams
East Anglia, Great Britain
 
I'm sorry I should have specified this is a "record selection formula". It does work in the regular formula editor.

Thanks
 
well it makes no sense in a Record Selection formula

What are you trying to accomplish for {equipment.eqnum}
just a display of the value????

take this out of the record select and apply it later when you want to display the value.




Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
If you want to select using a trimmed value, then set this up as a Formula Field. You should then be able to test this Formula Field in your Select statement. Or even put the whole test in a Formula Field and test for 'true' or 'false' in the select statement.

Madawc Williams
East Anglia, Great Britain
 
Orginially I wanted to do a Select distinct records On the frist four and three characters based on datalength. Now I'm just using the formula in a formula field, grouping by the formula and hiding the detail section. Thanks for everybodys help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top