Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    51

    Unanswered: Need decode/case statement

    If admitmonth=9 and dschmonth=10 then
    answer='1-oct-03'-admitdate
    else
    0.

    How can i do this using decode/case.
    sampath gowri

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    CASE
    WHEN <condition> THEN <expression1>
    ELSE <expression2>
    END

    i.e.

    CASE
    WHEN admitmonth=9 and dschmonth=10
    THEN to_date('01-oct-2003','DD-MON-YYYY')-admitdate
    ELSE 0
    END

    (Note correct specification of date using to_date function!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •