Need to to display first 14 days and then next 10 weeks data

Hi Gurus,

I have a requirement where i have to dispaly first 14 days data then next 10 weeks data in a cross tab. my requirement is if the day is prior to Wednesday then i have to display inclusing that week 14 days , if the day is wednesday or after wednesday then i have to calculate the 14 days begning of the next week(monday) then next 10 weeks after 14 days. I am using freehand SQL. Please provide your valuable inputs on how to do this. User is going to be prompted for the date then i am making that as a day with in Crystal. here i need some support how to move for the next 14 days and 10 weeks.

Thanks in Advance,
Caitanya


Caitanya.Candra (BOB member since 2008-08-04)

Did you think of using Union? One result for daily and another for weekly. Weekly can use Week Start Date or End Date.

Other logic needed to get 14 days, can you provide an example for both the cases? I am sure it would be acheivable with SQL easily


cpmohanraj :australia: (BOB member since 2002-09-23)

Hi,

I don’t think we can do this with simple union, bcoz the first 14days are not static. Depending on the date those will vary. for example if i enter 04/10/2012(Tuesday) then i have to display from 04/09/2012 to 04/21/2012 then next 10 weekends starting from 04/28/2012. if i enter date as 04/11/2012 then i have to display the 14day from 04/15/2012 to 04/28/2012 then next 10 weekends starting from 05/05/2012.

Thanks in advance
Caitanya


Caitanya.Candra (BOB member since 2008-08-04)