SQL Query?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sc5502
    New Member
    • Jun 2014
    • 102

    SQL Query?

    I have a SQL table with a field that has a length of 1. The field is named Status and has a value of I (inactive) or A (active). Status varchar(1). I want to show either Inactive or Active instead of just an I or A. Is this possible?
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    Sure,

    Take a look at the Case expression.

    Code:
    SELECT CASE [Status] WHEN 'I' THEN 'Inactive' ELSE 'Active' END AS [Status] FROM [Your table name]

    Gaz

    Comment

    • sc5502
      New Member
      • Jun 2014
      • 102

      #3
      Thank you very much.

      Comment

      Working...