I\'m a SQL guy, but I need a function to calculate the number of weekdays between two dates in VB.NET. I don\'t need to worry about holidays. My attempts unfortunately have
You don't need to check whether every single day between those dates is a weekday.
If there are n days, then there are int(n / 7) complete weeks, each containing 5 weekdays, so that's 5 * int(n / 7) weekdays.
n
int(n / 7)
5 * int(n / 7)
You then need to check the days of the remaining partial week (0..6 days).