select cast(max(start_date) as DATE)
from time_table
where time_table.routes_id = :id_routes
and time_table.start_date <= :RouteDepDate
into :tmpdate;
select MO,TU,WE,TH,FR,SA,SU from time_table where
time_table.start_date = :tmpdate
and time_table.routes_id = :id_routes
into
:MO,:TU,:WE,:TH,:FR,:SA,:SU ;
|