January 18, 2012 at 12:14 am
I have a table with a Employee Status column with values 0 or 1 or 2
Instead of printing the values I would like to view the result as
if the value is 0 then it should output Active
if the value is 1 then it should output Leave
if the value is 2 then it should output Terminated
Thanks
January 18, 2012 at 12:25 am
nfpacct (1/18/2012)
I have a table with a Employee Status column with values 0 or 1 or 2Instead of printing the values I would like to view the result as
if the value is 0 then it should output Active
if the value is 1 then it should output Leave
if the value is 2 then it should output Terminated
Thanks
Read about CASE in Books Online.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
January 18, 2012 at 12:34 am
'case when' may give you solution but I suggest create a reference/lookup table for those values and join it with your table to normalize your data.
"Often speak with code not with word,
A simple solution for a simple question"
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply