• anand.ramanan (8/11/2009)


    Nigel,

    I think you missed my post on page 1. It has as a similar implementation, and it allows to find the first sunday - saturday of the month. I did not spend time modifying the calculation of the first of the month. Your implementation is nice though.

    Anand,

    Only problem with your solution is that it relies on DATEFIRST having the default value of 7, as you mentioned in your first post.

    Although I do like the option to adjust which day to calculate.

    This can also be done in my solution by adjusting the constant value of 14. ie 15 will give you the first Sunday and 20 the first Friday etc.