SELECT
ProductDeliveryCertDiary.certificationReceivedDate,
ProductDeliveryCertDiary.periodFromDate,
ProductDeliveryCertDiary.periodToDate,
ProductDeliveryCertDiary.documentRefNumber,
ProductDeliveryCertDiary.fileRefNumber,
ProductDeliveryCertDiary.certificationDiaryID,
ProductDeliveryCertDiary.comments,
ProductDeliveryCertDiary.statusCode
INTO
:certificationReceivedDate,
:periodFromDate,
:periodToDate,
:documentRefNumber,
:fileRefNumber,
:certificationDiaryID,
:comments,
:statusCode
FROM
ProductDeliveryCertDiary
WHERE ProductDeliveryCertDiary.caseID = :caseID
AND :dateOfCalculation >= ProductDeliveryCertDiary.periodFromDate
AND :dateOfCalculation <= ProductDeliveryCertDiary.periodToDate
AND ProductDeliveryCertDiary.statusCode = :activeStatusCode
|