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

Fields on the Report 1

Status
Not open for further replies.

Howard2002

Programmer
Aug 2, 2002
12
US
In my report design there is a field called Sex. In my table the field has either a '1' for Male or '2' for Female. my question is how do I write code behind the textSex field on the report to display 'Male' or 'Female' or 'Unknown'(if there is no entry in the table field).
 
This code in testsex should do it :

iif(sex=1,'Male',iif(sex=2,'Female','Unknown'))
 
Included quotes since sex was a character field:

iif(sex='1','Male',iif(sex='2','Female','Unknown'))
 
Thanks, I had tried the iif but did not have the syntax right. I am so thankfull for Tek_Tips because the VFP books just do not explain this stuff completely and give good examples,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top