Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL EASY QUESTION ?

Posted on 2004-03-25
7
Medium Priority
?
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 80 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 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