• I also changed this line to convert char to datetime -- before that I was getting lots of very old log entries emailed to me. 

    -- next, find the current max date in the ErrorsP1 table

    Select

    @MxDateDel = max(convert(datetime,Error_date)) from ErrorsP1

    Also removed "login failed for user" from ErrorlogScanExclude table because I don't get many and wanted to see them.

    INSERT INTO dbo.ErrorlogScanExclude ( Excludekeyword )

       VALUES ( 'Login failed for user' )

    go