Solved

How to cast an int to be bit (True/False)?

Posted on 2007-03-26
2
263 Views
Last Modified: 2012-08-14
The stored procedure that I am working on requires to return true/false when the field flag is (int) 1 / (int) 0
How do I do it?
0
Comment
Question by:chuang4630
[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
2 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 18793696
SELECT Case(intFiledForBit) WHEN 1 then 'True' WHEN 0 THEN 'False' END  as Boolean
FROM urTable
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 18796857
It depends on the fron-end language you are using.  With VB classic and .NET (VB or C#) you should be able to use a bit data type and it should interpret it as a boolean as in:

Select CAST(YourColumn as bit)
From YourTableName
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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