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

Number value to text

Status
Not open for further replies.

SA812

Technical User
Jan 14, 2002
66
0
0
US
Hi guys,
I'm trying to convert a number value to text. I have a table with a field called status. I'd like to convert the number 2 to "Inactive"

ToText ({timWhseBin.Status},2) THEN ('Inactive')

When i run it it says the remaining text does not appear to be part of a formula.

Thanks for you help
SA

 
YOu can just use

@Status

If {timWhseBin.Status} = 2 then "Inactive" else ""

This will return "" for all other status. Ideally you should have a status table, just join that to your data and use that to display actual status in words.

Ian
 
Should i not be using this formula in a select expert?
Should i create a new un-bound field and use the formula there?
I tried putting the formula in the select expert but keep getting an error "The result of selection formula must be a boolean" I could just create a SQL view and do a CASE statement but was hoping to avoid it since it's such a simple report.

Thanks for your help!
SA
 
YOu did not mention that you wanted to filter your data.

If you only want to see Inactive records then simply add this to select expert

{timWhseBin.Status} = 2

Your original post indicated that you wanted to see the word Inactive in the report instead of the number 2. My original formula will do that, just place it on the details section and you will see.

Ian
 
Still got an error. Here is what i did i created a formula field and used the folowing text:

If {timWhseBin.Status} = 2 Then
Formula = "Inactive"
Else
Formula = "Active"
End If
 
Crystal Syntax does not require end if or the use of formula

Create a formula called Status and in editor just type

If {timWhseBin.Status} = 2 Then
"Inactive"
Else
"Active"

Ian




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top