Data Manipulation http://forums.asp.net/t/297998.aspx/1?Data+Manipulation+Wed, 06 Aug 2003 06:45:45 -0400297998297998http://forums.asp.net/p/297998/297998.aspx/1?Data+Manipulation+Data Manipulation HI everyone, I have a column STATUS of type bit(1,0) , i would like to manipulate it(without editing the database) in the Store Procedure in such a way that if STATUS =1 // return result STATUS= 'Active ' Else if STATUS = 0 // return result STATUS = 'Inactive' End if My Stored Procedure Is As Follow SELECT <b>STATUS</b> &#43; '--' &#43; NAME AS STATUSNAME FROM M_USER END Desired Result When Populated Into a Listbox Should Be As Follow Active--Tester Inactive--Tester1 Thanks In Advance for the Help Provided! 2003-08-02T02:53:38-04:00298023http://forums.asp.net/p/297998/298023.aspx/1?Re+Data+Manipulation+Re: Data Manipulation <pre class="prettyprint">SELECT CASE When Status = 1 Then 'Active' ELSE 'Inactive' END As STATUSNAME FROM M_USER</pre> :) JB 2003-08-02T04:51:23-04:00298865http://forums.asp.net/p/297998/298865.aspx/1?Re+Data+Manipulation+Re: Data Manipulation Thanks JBelthoff for the reply, I follow ur example but its still not working , the code are as follow, IF (@MASTER = 'NRICSEARCH') BEGIN SELECT CASE WHEN ACTIVE= 1 THEN 'ACTIVE' ELSE 'INACTIVE' END AS ACTIVE, USER_ID, NRIC &#43; '--' &#43; NAME&#43; '(' &#43; CONVERT(VARCHAR, ACTIVE) &#43; ')' AS NRICNAME FROM M_USER ORDER BY NRIC -- Column ACTIVE is of type bit. NRICNAME is used in the listbox as datatextfield The <b>Current Output</b> from the current code in the listbox is as follow, 123--Ben(0) 124--Andy(1) The <b>Desired Output</b> in the listbox is as follow, 123--Ben(ACTIVE) 124--Andy(INACTIVE) Apparantly, The CASE is not working. 2003-08-04T03:38:04-04:00299446http://forums.asp.net/p/297998/299446.aspx/1?Re+Data+Manipulation+Re: Data Manipulation <b>To get a 1 column result set in your desired output.........</b> <pre class="prettyprint">SELECT CAST(USER_ID As Varchar) &#43; '--' &#43; NAME &#43; '(' &#43; CASE WHEN ACTIVE= 1 THEN 'ACTIVE' ELSE 'INACTIVE' END &#43; ')' As NRICNAME FROM M_USER</pre> :-D Enjoy! JB 2003-08-04T17:45:34-04:00301090http://forums.asp.net/p/297998/301090.aspx/1?Re+Data+Manipulation+Re: Data Manipulation Hi JB, Its working now, thanks a lot. 2003-08-06T06:28:21-04:00