SELECT
Slot.slotID,
Slot.scheduleID,
Slot.name,
Slot.startTime,
Slot.endTime,
Slot.recordStatus,
Slot.comments,
Slot.maxWorkUnits,
Slot.versionNo
INTO
:slotID,
:scheduleID,
:name,
:startTime,
:endTime,
:recordStatus,
:comments,
:maxWorkUnits,
:versionNo
FROM
DailySchedule,
Slot
WHERE DailySchedule.locationID = :locationID
AND DailySchedule.effectiveDate =
(
SELECT
MAX(effectiveDate)
FROM
DailySchedule
WHERE effectiveDate <= :effectiveDate
AND DailySchedule.locationID = :locationID
)
AND Slot.scheduleID = DailySchedule.scheduleID
AND Slot.startTime = :startTime
|