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
Solved

Return bit - return replace with a specific word

Posted on 2009-06-28
3
197 Views
Last Modified: 2012-05-07
I have a Bit column. How can I return "Black" if it is true and "White" if it is false?
0
Comment
Question by:johnkainn
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 125 total points
ID: 24730840
select case when bitColumn = '1' THEN 'Black' else 'White' END
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 125 total points
ID: 24730842
Hope this helps:

SELECT CASE WHEN ur_bit_column = 1 THEN 'Black' ELSE 'White' END as result
FROM ur_table

Replace ur_bit_column and ur_table names accordingly.
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24730845
aneeshattingal,
    You typed so fast compared to me..
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Review MS SQL cluster diagram 9 100
Sql query 107 73
Error in SSIS while executing  - Potential data loss 4 31
Find results from sql within a time span 11 46
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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