• Just out of interest, This is possibly a lot more difficult to understand, but shorter. (the same code will detect the nth day you specify. I just stripped it down a bit to do the first monday! See https://www.simple-talk.com/sql/learn-sql-server/robyn-pages-sql-server-datetime-workbench/ )

    [font="Courier New"]

    IF OBJECT_ID (N'firstMondayOfMonth') IS NOT NULL

      DROP FUNCTION firstMondayOfMonth

    GO

    CREATE FUNCTION firstMondayOfMonth (@TheYear CHAR(4), @TheMonth CHAR(3))

    RETURNS DATETIME

    WITH EXECUTE AS CALLER

    AS

      BEGIN

      RETURN DATEADD(MONTH, DATEDIFF(MONTH, 0, CONVERT(date,'1 '+@TheMonth+' '+@TheYear,113)), 0)+6

            -(DATEPART (Weekday, DATEADD(MONTH, DATEDIFF(MONTH, 0, CONVERT(date,'1 '+@TheMonth+' '+@TheYear,113)), 0))

              +@@DateFirst+4)%7

      END

    GO

    IF (

      SELECT dbo.FirstMondayOfMonth ('2012','jun'))<> '2012-06-04'

      RAISERROR('''firstMondayOfMonth'' stopped working (1)',16,1)

    IF (

      SELECT dbo.FirstMondayOfMonth ('2014','Sep'))<> '2014-09-01'

      RAISERROR('''firstMondayOfMonth'' stopped working (2)',16,1)

          [/font]

    Best wishes,
    Phil Factor