Home Forums SQL Server 2005 T-SQL (SS2K5) How to find the 2nd Monday following a given date. RE: How to find the 2nd Monday following a given date.

  • Remember that SET DATEFIRST will recompile your code. And also, not everyone has DATEFIRST 1 as default setting.

    Try this code that is safe and doesn't rely on any setting and also, if doesn't have the annoying time portion.

    SELECTGETDATE() AS Today,

    DATEADD(DAY, DATEDIFF(DAY, '19000101', GETDATE()) / 7 * 7, '19000108') AS NextMonday,

    DATEADD(DAY, DATEDIFF(DAY, '19000101', GETDATE()) / 7 * 7, '19000115') AS MondayAfterNext


    N 56°04'39.16"
    E 12°55'05.25"