Database SQL Operation: CaseTransactionLog.readNearestByCaseAndType
Description: | This operation is used to read the nearest record in the past to the input date, for a given case and transaction type. |
Sterotype: | ns |
SELECT
transactionID,
userName
INTO
:transactionID,
:userName
FROM
CaseTransactionLog
WHERE caseID = :caseID
AND transactionType = :transactionType
AND transactionDateTime =
(
SELECT
MAX(transactionDateTime)
FROM
CaseTransactionLog
WHERE caseID = :caseID
AND transactionType = :transactionType
AND transactionDateTime <= :dateTime
)
|