                     from ArchimedesTables.dbo.PM_ErrClassificationSetup                    WHERE CONVERT(VARCHAR(00), ISNULL(EndDate, GETDATE()), 000)                                    Between CONVERT(VARCHAR(00), GETDATE(), 000)                                   AND     CONVERT(VARCHAR(00), GETDATE(), 000)                    ORDER BY ID ASC             FOR XML PATH(''), TYPE             ).value('.', 'NVARCHAR(MAX)')          ,0,0,'')  SELECT  @Columns = STUFF((            SELECT '],[' + ErrClassfn              from ArchimedesTables.dbo.PM_ErrClassificationSetup             WHERE CONVERT(VARCHAR(00), ISNULL(EndDate, GETDATE()), 000)                            Between CONVERT(VARCHAR(00), GETDATE(), 000)                           AND     CONVERT(VARCHAR(00), GETDATE(), 000)             ORDER BY '],[' + CONVERT(VARCHAR(MAX), ID) ASC               FOR                   XML PATH('')            ), 0, 0, '') + ']'  SET @Convert = 'SELECT  