Solved

SQL EASY QUESTION ?

Posted on 2004-03-25
7
197 Views
Last Modified: 2010-04-05
I want this instruction  give me string result not Boolean value

Select  table1.booleanfield where table1.name=jone

What I want is : if booleanfield = true then the result of  instruction is ‘ good ‘
                           if booleanfield = false then the result of  instruction is ‘ bad ‘

I am waiting your  for your help .
0
Comment
Question by:peruzzi
7 Comments
 
LVL 3

Expert Comment

by:concon
ID: 10675501
Hi peruzzi,

what is your db? if sql/server :

select case(booleanfield
            when true then 'good'
            when false then 'bad'
            end) from table1 where name='jone'

Regards.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10675517
there is a TBooleanField,
which should be automatically
assigned to your table-boolean field

there is a property DisplayValues
add there good;bad

meikl ;-)
0
 
LVL 6

Accepted Solution

by:
wimmeyvaert earned 20 total points
ID: 10676125
I think kretzschmar has it right.

Some more explanation :

If you doubleclick your TTable-Component in Delphi IDE, then do CTRL-F to add all fields linked to the Table you provided in TableName-property of your TTable.

Now you should see the BooleanField between all the other fields. Click on this field an go to the Object Inspector. change the Property 'DisplayValues' into good;bad.

If you now drag and drop this BooleanField from the FieldEditor (doubleclicking on TTable) to your Form, you should see 'good' if this field contains True and 'bad' if the field contains 'False' at runtime.

Hope I was of some help. Anyway the Kretzschmar had the right answer to your Q. I just tried to clarified the way of working.

Best regards,

The Mayor.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 10676164
This also works for a TQuery-component !!
0
 

Author Comment

by:peruzzi
ID: 10679109
Hi guys
wimmeyvaert , I choose your answer
I wanted to spilt the points between you and kretzschmar but I could not
so I choose the useful answer for me and give it the point.
 thank thanks for all
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10679675
hi peruzzi,

this is ok

wimmeyvaert explains it complete, so he earnes the points.
i'm not worry about this.

good luck again

meikl ;-)
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 10684819
Hi all,

Kretzschmar, thanks you are ok with it.
It was not my intention to steel the points from you. I just explained in detail what you suggested.
Long live the fairness !!!

Thanks again,

The Mayor.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now