SELECT
tsk_enableenhancedplanning enableenhancedplanning,
ock_code ock_code,
tsk_desc taskplandescription,
ock_task ock_task,
ock_taskrev ock_taskrev,
ock_status ock_status,
ock_org ock_org,
ock_object ock_object,
ock_object_org ock_object_org,
obj_desc equipmentdesc
FROM  r5operatorchecklists, r5tasks, r5objects
WHERE ock_createdby = <parameter.r5user>
AND ock_rstatus = 'U'
AND ock_enddate IS NULL
AND strftime('%Y-%m-%d', <param.orgdate>) = strftime('%Y-%m-%d', OCK_STARTDATE)
AND ock_task = tsk_code
AND ock_taskrev = tsk_revision
AND tsk_code = ock_task
AND obj_code = ock_object
AND ock_object_org = obj_org
