December 21, 200817 yr I have a problem where I need to calculate to the next date of a particular weekday. Let say: Start_Date = Monday, 8th December 2008 Period= 4 Weeks Calc_End_Date = Must be the weekday of the Start_Date in a Period of 4 weeks (=5th of January '09) If I use the Date Function, Day (Start_date + 28), it doesn't work always because it calculates the day not the weekday. How do I calculate the weekdays if I want to use the Date function? Thanks
December 21, 200817 yr If I use the Date Function, Day (Start_date + 28), it doesn't work always because it calculates the day not the weekday. It's not quite clear what you're doing there. Day (Start_date + 28) will give you the day-of-the-month of the target day, i.e. 5 using your example (Jan 5, 2009). If you do the same for the month and the year, you should get the correct result at the end. However, it's quite unnecessary to use the Date() function for this: Start_Date + 7 * Period should do the job.
December 21, 200817 yr Author Sorry if it wasn't clear, Here my situation: I need to calculate when a contract is finished. I have a start date and a period. The end date must fall on the same weekday as the start weekday. So, I need to calculate Weekday times period (4 Weeks = 28 days). For me its not clear what to use to get the right result.
December 21, 200817 yr If the period is given as number of weeks then: Start_Date + 7 * Period will always be the same day-of-week as Start_Date (unless Period is a fraction...).
Create an account or sign in to comment