Friday, February 24, 2012

Logic for adding dates

If I use dateadd(dd,n,@.fromdate), it gives me the result including the weekends, is there a way to find the target date without including weekends. Please help.There isn't a way with the dateadd function. You'll need to create a date table that excludes weekends and holidays. You can the do a count from the table BETWEEN @.startdate and @.enddate.|||What logic do you want? I can think of two possibilities:

A) If date falls on a weekend, use following Monday instead.

and 2) "n" represents the number of non-weekend days to increment @.fromdate.|||Yes, if the date falls on a weekend then we would use the following Monday. I've got the field updating OK on the plus 3 days but now I have to account for the weekends and holidays.|||Dude! Are you the original poster? This thread is three years old!|||Nope sorry wrong thread.|||Wrong thread.

No comments:

Post a Comment