×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

Trying to display "Yes or No" from logical field

Trying to display "Yes or No" from logical field

(OP)
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

RE: Trying to display "Yes or No" from logical field

Well you are already doing it with Salary, so why not do the same with Active?

RE: Trying to display "Yes or No" from logical field

Then do it like you do for Salary field.

Borislav Borissov
VFP9 SP2, SQL Server

RE: Trying to display "Yes or No" from logical field

2
Actually, it's even simpler:

SELECT .... IIF(Inactive, "No ", "Yes") AS Active ...

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

RE: Trying to display "Yes or No" from logical field

Mike, your'e right of course (as so often) :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close