IF Statement in a View or Stored Procedure
Posted on 2003-02-26
I have a table that has Three Bit fields (True/False) One of these three fields is always checked.
I want my view to have a field that evaluates these three fields and tells me the which area I am in.
Here is the psuedocode that I want translated into sql.
If Area1 is True, then "Washington"
If Area2 is True, "Oregon"
I want that to process as field WhatArea
Any help is appreciated.
P.S. I know this can be done in Access queries as I have already made it there. I am trying to port that query into a SQL Server 2000 View. The statement in Access 2000 was:
Iif(Area1=-1,"Washington", Iif(Area2=-1,"Oregon","Idaho")) as Whatarea