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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT statement

Status
Not open for further replies.
Joined
Sep 27, 2001
Messages
179
Location
AU
Hi

Using MSSQL 7.

I have a column called CODE containing a 3-letter code, e.g. SUC.

I would like to do a simple SELECT statement but return SUCESSFUL where CODE = SUC rather than SUC.

Can this be done?

Thanks
Rob
 
How about a CASE statement like this:

select
CASE CODE
WHEN 'SUC' THEN 'Successful'
ELSE CODE
END as 'Full Word'
from TableName

Hope that helps.
Sharon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top