Could someone please help.... ? below are my code on how to create indate and outdate.
-
If Not IsNull(rst2.Fields("Days_Required")) Then
-
days = rst2.Fields("Days_Required")
-
-
End If
-
-
enddate = rst2.Fields("FinalDate")
-
If days = 0 Then
-
startdate = enddate
-
Else
-
startdate = DateAdd("w", -days, enddate)
-
-
End If
the calculation for startdate and enddate are correct according to days required. the problem is that it calculates weekend as well. for example: enddate is 1/27/09, it required to works for 8 days, then the start date should be enddate - 8 days (exclude weekend sat and sun) = 1/16/09, but the code is giving me 1/20/09 as startdate.
Can someone help me?? I thought "w" is for weekdays only