Re: [SQL] SQL Challenge: Skip Weekends

2002-06-21 Thread Josh Berkus
Joe, > How about this (a bit ugly, but I think it does what you want -- > minus the holidays, which you said you already have figured out): > > create or replace function > get_future_work_day(timestamp, int) Thank you. Once again, you come to the rescue when I'm stuck. I'll try your soluti

Re: [SQL] SQL Challenge: Skip Weekends

2002-06-21 Thread Josh Berkus
Jean-Luc, > date := now - day_of_the_week > interval := interval + day_of_the_week > date := date + int( interval/5)x7 + ( interval mod 5) Merci, merci, merci! -Josh ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send a

Re: [SQL] SQL Challenge: Skip Weekends

2002-06-21 Thread Jean-Luc Lachance
here is the algorithm: date := now - day_of_the_week interval := interval + day_of_the_week date := date + int( interval/5)x7 + ( interval mod 5) Josh Berkus wrote: > > Folks, > > Hey, I need to write a date calculation function that calculates the date > after a number of *workdays* from a s

Re: [SQL] SQL Challenge: Skip Weekends

2002-06-20 Thread Joe Conway
Josh Berkus wrote: > Folks, > > Hey, I need to write a date calculation function that calculates the > date after a number of *workdays* from a specific date. I pretty > much have the "skip holidays" part nailed down, but I don't have a > really good way to skip all weekends in the calucla

[SQL] SQL Challenge: Skip Weekends

2002-06-20 Thread Josh Berkus
Folks, Hey, I need to write a date calculation function that calculates the date after a number of *workdays* from a specific date. I pretty much have the "skip holidays" part nailed down, but I don't have a really good way to skip all weekends in the caluclation. Here's the ideas I've come