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

Convert integer (1) to a character (X) .... please help 1

Status
Not open for further replies.

mstelmac

Technical User
Oct 22, 2003
53
US
Hello everyone. My database stores check boxes as either a 1 (checked) or a 0 (unchecked, default). I want my report to replace the 1 with an X. If the value is a 0 then I do not want an X to appear. I was thinking it might be possible by using the select expert???? Can anyone lend a hand? I am using CR8.

Thank you very much,
-Matt
 
I'm not really clear on what you are trying to do--or what the current field does. Does it display a 1 or 0? Where does the checkbox fit in? If you want to display an "X" instead of a 1, then try:

if {table.field} = 1 then "X" else ""

-LB

 
LB thats exactly what I need but I am unsure where to put it??? The database I have accepts the value 1 when a user checks a box. So the field value is always a 1 or a 0. My dilema is how do I represent this on a report. I figured I would place the field on the report and convert all of the 1's to X's. Do you know where in CR I would go to input your formula?

Thanks,
Matt
 
Create this in the formula editor, and then drag it onto your report. If you are trying to create a box with an "x" in it, then drag it into a text box, center it, and put borders on the text box. You could also (instead) create a formula:

if {table.field} = 1 then
chr(254)
else chr(168)

Then right click on this formula->paragraph formatting->text interpretation->HTML text.

-LB
 
Oops. That should be: Change the font to "wingdings". You can also use chr(120) to get an "x" instead of a checkmark.

-LB
 
lbass are you using CR8. I cannot drag the formula onto the textbox. I am also unsure where to write the formula. You mentioned to use the formula editor but I cannot find it. When I right click on a field I get "Format Field" then there are options to write suppression formulas.
 
Yes, I am using CR 8.0. In your field explorer go to formula fields->new and enter it there. Then drag it into the text box. Play around until it "snaps" into place.

-LB
 
DOHHHHH,
Ok I just smacked myself in the face for you. I see what you are saying and it is working fine. Thanks for your patience.
-Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top