OK... Decided to post regardless of the answer to whether 6 days is a hard value.

If it is, the following works, without recursion.

Unfortunately I cannot currently performance test this.

update orders set ship_date =
select day6.dt from
calndr day1, calndr day2, calndr day3
, calndr day4, calndr day5, calndr day6
where day1.dt=(select min(dt) from dates where dt>order_date
and flag='Y')
and day2.dt=(select min(dt) from dates where dt>day1.dt
and flag='Y')
and day3.dt=(select min(dt) from dates where dt>day2.dt
and flag='Y')
and day4.dt=(select min(dt) from dates where dt>day3.dt
and flag='Y')
and day5.dt=(select min(dt) from dates where dt>day4.dt
and flag='Y')
and day6.dt=(select min(dt) from dates where dt>day5.dt
and flag='Y')



Never say, "never."
---
--
Dennis

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.