Database SQL Operation: ISPSpendDown.searchMostRecentSupersededSpendDown
Description: | This method searches for the most recently superseded SpendDown record between a specified start and end date. |
Sterotype: | ns |
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
)
|