Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    29

    Unanswered: Case statement Help

    Hello All,

    i need some help with case staement here is the statement

    case
    when PDRECS='C' and PDCNDT < to_date('01/01/2010','mm/dd/yyyy') then 'LAPSED'
    when PDRECS='C' AND PDTRSC LIKE 'F%' and PDCNDT < to_date('01/01/2010','mm/dd/yyyy') THEN 'RESCINDED'
    when PDRECS='A' THEN 'ACTIVE'
    end) as policy_status




    -----------------------
    To the above statement i need to add one more condition

    like-- If PDRECS not in 'A' or 'C' then only check for 'D' at max(pdrenn) and max(pdseqn)

    what i mean here is if pdrecs is not in A or C i wanted check for D only at Max renewal and max sequence number


    how can i add this statement?


    Thanks in Advance!!
    Hasya

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    add it at the end of the case.
    case goes in order from top-->down
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Dec 2003
    Posts
    1,074
    Sounds like you might need an inline view which performs the aggregation, then you'd draw from that in your CASE statement.

    --=Chuck

Posting Permissions

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