First, this is a SQL question, not asp.net question.
Second, you need to use CASE, WHEN is just a part of that:

CASE WHEN [status] = 'ACTIVE' THEN [status] ELSE NULL END

BTW why don't you just use bit for active, it would be a lot faster and you
wouldn't have to worry about the proper spelling and casing...

Jerry

"Micheal" <frooyo@sbcglobal.net> wrote in message
news:e8Pn6VDXDHA.2344@TK2MSFTNGP09.phx.gbl...
> I want to create a 'view' but have a condition on a column based on
another
> column. Basically, I want to do this:
>
> CREATE VIEW MyView
> AS
> SELECT [id] AS dept_id,
> [name] AS dept_name,
> url WHEN STATUS = 'ACTIVE'
> FROM department
> WHERE event_sharing = 'on'
>
>
> What I want to do is only display the URL field when the Status =
'Active',
> and if Status <> 'Acitve' I want to return a null/blank URL field.
>
>