Empirical Engineering.
The original result was always the first Sunday of the month, regardless of what .wDay was, so we had to add 7 * (the number of weeks - 1).
On further reflectionis a much simpler solution - instead of fixing the error, just don't cause it in the first place.vb Code:
tmp = DateSerial(tziYear, _ .wMonth, _ (.wDayOfWeek - MonthFirstWeekday + _ .wDay * 7) + 1)





Reply With Quote