Operation Details
Description: Return a record which has the same caseID and dateOfCalculation is in between fromDate and toDate. StatusCode will be the input attribute, This will decide what kind of records to be retrieved from the database i.e. Active or Canceled
Sterotype: ns
SQL
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