Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show Vacant when 1

Status
Not open for further replies.

OldSlowDog

Programmer
Mar 11, 2002
36
US
Hello,
Is it possible to have sql to transalte a code to a text?
I have a PROPERTY table and it has an int field VACANT which is either 0 or 1.

SELECT Address, KepMap, VACANT
FROM PROPERTY
WHERE CITY = 'Dallas'

What I want to show is the word Vacant or Occupied rather than a 0 or 1. (0=Occupied, 1=Vacant)

Thanks for helping.
 
SELECT Address,
KepMap,
CASE VACANT
WHEN 1
THEN 'VACANT'
ELSE 'OCCUPIED'
END
FROM PROPERTY
WHERE CITY = 'Dallas'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top