loop
/*
desription Get the date of the first sunday.
parameter vd_first_week_date
*/
if vi_loop_num > 6 then
exit;
else
if to_char(vd_flag_date+vi_loop_num,'D') = 1 then
vd_first_week_date := vd_flag_date+vi_loop_num;
exit;
else
vi_loop_num := vi_loop_num+1;
end if;
end if;
end loop;
if vd_deal_date < vd_first_week_date then
ov_return := to_char(vd_deal_date,'yyyy')||'01';