C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

To Tejinder Singh Barnala-> Its Urgent


Posted Date: 01 Jan 2009      Posted By: Muraleedharan.k      Member Level: Silver     Points: 1   Responses: 2



I had a three status field in my table and each status fields datatype as bit.Here my question is i have to display three status fields in one field means if the first status field is true and other 2 status fields are false.Then i have 2 display only first status field and not displays the other two status fields.Similarly 4 other condition also.Plz give the code for that.Its urgent.




Responses

Author: Babu Akkandi    01 Jan 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

Use "Case When ..." Statement in your Query.

Hope it helps!

if you need some more help on this, please give your table structure, conditions to fetch the record, and output columns required?

Thanks and Regards,
Babu Akkandi
Microsoft Technology



Author: Tejinder Singh Barnala    01 Jan 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 3

muraleedharan , i have one dought

suppose your tale look like

name status1 status2 status3
test 1 0 0
test1 0 1 0
test2 0 0 1
test3 1 1 0

now you want result as

name status
test status1
test1 status2
test2 status3
test3 status1, status2

or
in any other way , please paste requested output for the table given by me, then only i will be able to provide you any solution.

name

Many Thanks
Tejinder Singh Barnala
/*I have the simplest tastes. I am always satisfied with the best*/



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Storing Excel file into SQL Server database
Previous : SSRS 2005
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use