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

Trying to display "Yes or No" from logical field 4

Status
Not open for further replies.
Jan 20, 2007
237
0
0
US
Hi Everyone
i have this select below
Code:
Select empno As Emp_Number, name As First_Name, Last As Last_Name, time_type As Time_Type, dept As Department ,;
	IiF(salary=2, 'Yes','No') As Salary, IiF(inactive=.F., 'Y','N') As Active From empname Where Not Deleted() Into Cursor junkreport NOFILTER Order By 1

where as you can the "inactive" field is logical and course i am using this cursor result to be going to excel so i would like the column "Active" in excel, instead of being Y or N , to be Yes or No
is there a way to accomplish this ?
Thanks in advance
 
Well you are already doing it with Salary, so why not do the same with Active?
 
Then do it like you do for Salary field.

Borislav Borissov
VFP9 SP2, SQL Server
 
Actually, it's even simpler:

[tt]SELECT .... IIF(Inactive, "No ", "Yes") AS Active ...[/tt]

Note he extra space after No. This is necessary because otherwise, if the first record returned No, the field would only be two characters wide, so Yes would be truncated.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top