Hello Dave ...
While the logic you describe is easy to code for, it is also a bit slower -- especially if the date range is long. The code I have posted, while long (it is filled with comments :) ), has successfully been in use by many, and has been tested as faster than the looping you are...