Operation Details
Description: Returns details from the most recent SpendDown period for the SpendDown product delivery.
Sterotype: ns
SQL
SELECT
  spendDownID,
  startDate,
  endDate,
  spenddownStatusCode,
  metInd
INTO
  :spendDownID,
  :startDate,
  :endDate,
  :spendDownStatusCode,
  :metInd 
FROM
  ISPSpendDown 
WHERE ISPSpendDown.caseID = :caseID 
  AND ISPSpendDown.statusCode = :statusCode 
  AND ISPSpendDown.startDate = ( 
  SELECT
    MAX (startDate) 
  FROM
    ISPSpendDown 
  WHERE ISPSpendDown.caseID = :caseID 
  )