Operation Details
Description:  
Sterotype: nsmulti
SQL
SELECT     
        DailySchedule.scheduleID,
        DailySchedule.locationID,
        DailySchedule.effectiveDate,
        DailySchedule.name,
        DailySchedule.comments,
        DailySchedule.recordStatus
      INTO
        :scheduleID,
        :locationID,
        :effectiveDate,
        :name,
        :comments,
        :recordStatus 
    FROM
      DailySchedule 
    WHERE DailySchedule.effectiveDate =
  ( 
     SELECT MAX(DailySchedule.effectiveDate)  FROM
      DailySchedule    
     WHERE DailySchedule.locationID = :locationID 
               AND (DailySchedule.type is null OR Dailyschedule.type = :locationScheduleType)
   AND DailySchedule.recordStatus = :status
    )