CASE stmt with isnull()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siddu
    New Member
    • Nov 2006
    • 42

    CASE stmt with isnull()

    select country,
    IsNull(A,0) as A,
    IsNull(B,0) as B,
    ---- Here I need to add case stmt. I have data B in Db if it is B then I have to show C else I have to C

    from <Table-name>

    Please help me how to do this? It is very urgent

    Thanks
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by siddu
    select country,
    IsNull(A,0) as A,
    IsNull(B,0) as B,
    ---- Here I need to add case stmt. I have data B in Db if it is B then I have to show C else I have to C

    from <Table-name>

    Please help me how to do this? It is very urgent

    Thanks

    Use CASSE

    -- CK

    Comment

    • ganeshkumar08
      New Member
      • Jan 2008
      • 31

      #3
      Hello

      Try this..

      select country,
      IsNull(A,0) as A,
      IsNull(B,0) as B,
      -- My code
      case when isnull(B,0) < = 0 then C else C End as 'C'
      from <Table-name>

      If this is not ok, please explain me clearly i write and give u...

      Ganesh

      Comment

      Working...