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

Symbol in an IF statement

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
I have a report that displays patient initials (Last Initial, First Initial). The report is displayed in a public area for the nurses to track patients. We use the initials for confidentiality.

For female patients, a pregnancy test must be done. The nurses used to be able to determine (for the most part) the gender of the person my their name - with the initials only it is difficult to do. Using a gender symbol on the report to denote patient sex would not violate confidentiality and it would tell the nurse if the patient was female or male.

I tried inserting a symbol in an if statement, without success. I was unable to insert a symbol. Can this be done? If yes, does anyone have any options. I am using Crystal 10.5.

Here is the statement I tried:
if {pcxPatient.sex} = "M" then "insert a symbol for the male gender here" else
if {pcxPatient.sex} = "F" then "insert a symbol for the female gender here" else " "

 
Hi,
Create a formula that substitutes the ASCII value of the desired sysbol ( using the CHR(xxx) function) and format that text to use the font that has the symbol ( try one of the wingdings, maybe)..

if {pcxPatient.sex} = "M" then chr(malesymbolasciivalue) else
chr(femalesymbolvalue)

place this formula in your report where you want the symbol to appear..

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks TurkBear, I am almost there, this iw what I ahve:

if {pcxPatient.sex} = "M" then chr(?) else chr (?)

I get an error message "the ) is missing"

Where does the ) go?
 
I'm not sure that will work - the ASCII code for the female symbol is 12, which is also a form feed. Will Crystal render as a visible character anything less than chr(32)?

I have another option that is somewhat more work, but that I've used in the past. Open up MS Word. Insert Symbol and insert the female sign into a document. (In Office XP, select "normal text" in the upper left and "Miscellaneous Dingbats" in the upper right to find it.)

Copy the female symbol and paste it into a text object in your report. Right-Click on the text object and select Format Text... In the suppress formula, put {pcxPatient.sex} <> "F". Do the same thing for the male symbol in a separate text object and changing the suppress formula accordingly. Then make the two objects the same size, and line up the top and left so that one is on top of the other where you want them to actually display on the report.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Why not just make them ! and * - not hard for nurses to learn, but it is also not likely to be noticed by outsiders.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi,
Use this formula:
Code:
If {GENDER_CD} = 'M' then chrW(9792) else chrW(9794)

and set the font to any Unicode one...




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
All of you are exceptional and they all work. Many, many thanks.
TurkBear: your last suggestion works perfectly (I will have to investigate whether the gender signs are correct for male and female, they may be transposed, but that I can do). Madawc: Your suggestion would probably work too and that was going to be my default - it is certainly pure and elegant. And, lastly Hilfy - I followed your recommendation exactly and it yielded a perfect result. Now I've got three solutions. Thanks again everyone :)
Jonathan
 
Hi,
Thanks, I learned something by trying solutions ( I had never noticed the chrW and ascW functions for using Unicode)
That is what I like most about these forums, postings lead to discoveries (and,by the way,yes,they were transposed (I typed too fast))..




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top