C
Cristen
Hello. I am using the following code to get the difference in minutes
between two dates, excluding weekends. It's working for all scenarios except
for when the end date is on a Saturday or Sunday. When that occurs I want it
to just calculate the difference between the two dates without any
modifications. Right now for those cases I am getting negative numbers. I
am not sure how to modify this code further to allow for that. I used this
code I found on another posting, so I'm not very advanced at this. Thank you
very much!
..iMin = Format(DateDiff("n", sPrevDate, sAppDate) - _
DateDiff("ww", sPrevDate, sAppDate, vbSunday) * 2880 - _
IIf(Weekday(sAppDate, vbSunday) = vbSaturday, _
IIf(Weekday(sPrevDate, vbSunday) = vbSaturday, 0, 1440), _
IIf(Weekday(sPrevDate, vbSunday) = vbSaturday, -1440, 0)), "###0.00")
between two dates, excluding weekends. It's working for all scenarios except
for when the end date is on a Saturday or Sunday. When that occurs I want it
to just calculate the difference between the two dates without any
modifications. Right now for those cases I am getting negative numbers. I
am not sure how to modify this code further to allow for that. I used this
code I found on another posting, so I'm not very advanced at this. Thank you
very much!
..iMin = Format(DateDiff("n", sPrevDate, sAppDate) - _
DateDiff("ww", sPrevDate, sAppDate, vbSunday) * 2880 - _
IIf(Weekday(sAppDate, vbSunday) = vbSaturday, _
IIf(Weekday(sPrevDate, vbSunday) = vbSaturday, 0, 1440), _
IIf(Weekday(sPrevDate, vbSunday) = vbSaturday, -1440, 0)), "###0.00")