Operation Details
Description: This method searches for the most recently superseded SpendDown record between a specified start and end date.
Sterotype: ns
SQL
SELECT
  spendDownID,
  amount,
  coverageStartDate
INTO
  :spendDownID,
  :spendDownAmount,
  :coverageStartDate 
FROM
  ISPSpendDown 
WHERE ISPSpendDown.caseID = :caseID 
  AND ISPSpendDown.statusCode = :statusCode 
  AND ISPSpendDown.startDate = :startDate 
  AND lastUpdatedDateTime = ( 
  SELECT
    MAX(lastUpdatedDateTime) 
  FROM
    ISPSpendDown 
  WHERE ISPSpendDown.caseID = :caseID 
    AND ISPSpendDown.statusCode = :statusCode 
    AND ISPSpendDown.startDate = :startDate 
  )