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

Replace values 1

Status
Not open for further replies.

emoongq

IS-IT--Management
Jun 3, 2004
23
MX
Hello I'm creating a view in which I need to replace values in a field named status from 'M' to 'C', is it possible, how?

Tks
 
Instead of selecting the status column, select something like this:

Code:
case status
when 'M' then 'C'
else status end

For more info, look up CASE in BOL.

Hope it helps,

Alex


Ignorance of certain subjects is a great part of wisdom
 
I'm not able to save the view or even run it on a DTS, any idea?

Tks
 
Ah, seems you are using enterprise mangler. I believe I have run into this problem before (unable to use CASE to create a view).

What you will need to do is create your view from query analyzer. It will be something like this:

Code:
create view myView as

--enter your query here
select * from someTable

The query you type should of course use the CASE statement. For more info look up CREATE VIEW in BOL.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top