<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <Body>
    <ReportItems>
      <Textbox Name="Textbox1">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value />
                <Style>
                  <FontSize>14pt</FontSize>
                </Style>
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>--To Copy the code, right click and export to Word</Value>
                <Style>
                  <FontSize>14pt</FontSize>
                </Style>
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value />
                <Style>
                  <FontSize>14pt</FontSize>
                </Style>
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>--I honestly don't remember where I picked this code up...so here are a few places in could have
--https://dba.stackexchange.com/questions/148321/list-jobs-schedules-and-next-scheduled-run-datetimes
--https://stackoverflow.com/questions/6538851/sql-scheduled-job-query-duration-of-last-runs/33109187

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED


SELECT    j.Name
	, CASE j.Enabled
			WHEN 1 THEN 'Yes'
			WHEN 0 THEN 'No'
	  END AS 'Job Enabled'
	, d.schedule_id
	, CASE WHEN d.schedule_id IS NOT NULL
			THEN CASE j.enabled
				WHEN 1 THEN 'Yes'
				WHEN 0 THEN 'No'
	  END
	  ELSE
		'Job Not Scheduled' END AS 'Schedule Enabled'
	, le.lastexecuted AS 'LastExecuted'
	, CASE d.freq_type
				WHEN 1 THEN 'Once'
				WHEN 4 THEN 'Daily'
				WHEN 8 THEN 'Weekly'
				WHEN 16 THEN 'Monthly'
				WHEN 32 THEN 'Monthly relative'
				WHEN 64 THEN 'When SQLServer Agent starts'
		END AS 'Frequency'
	, CASE NextRunDate
				WHEN 0 THEN NULL
				ELSE SUBSTRING(CONVERT(VARCHAR(15), NextRunDate), 1, 4) + '/' +
				SUBSTRING(CONVERT(VARCHAR(15), NextRunDate), 5, 2) + '/' +
				SUBSTRING(CONVERT(VARCHAR(15), NextRunDate), 7, 2)
		END AS 'NextRunDate'
	,  CASE LEN(NextRunTime)
				WHEN 1 THEN CAST('00:00:0' + RIGHT(NextRunTime, 2) AS CHAR(8))
				WHEN 2 THEN CAST('00:00:' + RIGHT(NextRunTime, 2) AS CHAR(8))
				WHEN 3 THEN CAST('00:0'
				+ LEFT(RIGHT(NextRunTime, 3), 1)
				+ ':' + RIGHT(NextRunTime, 2) AS CHAR(8))
				WHEN 4 THEN CAST('00:'
				+ LEFT(RIGHT(NextRunTime, 4), 2)
				+ ':' + RIGHT(NextRunTime, 2) AS CHAR(8))
				WHEN 5 THEN CAST('0'
				+ LEFT(RIGHT(NextRunTime, 5), 1)
				+ ':' + LEFT(RIGHT(NextRunTime, 4), 2)
				+ ':' + RIGHT(NextRunTime, 2) AS CHAR(8))
				WHEN 6 THEN CAST(LEFT(RIGHT(NextRunTime, 6), 2)
				+ ':' + LEFT(RIGHT(NextRunTime, 4), 2)
				+ ':' + RIGHT(NextRunTime, 2) AS CHAR(8))
		END AS 'NextRunTime'
	, CASE LEN(run_duration)
				WHEN 1 THEN CAST('00:00:0'
				+ CAST(run_duration AS CHAR) AS CHAR(8))
				WHEN 2 THEN CAST('00:00:'
				+ CAST(run_duration AS CHAR) AS CHAR(8))
				WHEN 3 THEN CAST('00:0'
				+ LEFT(RIGHT(run_duration, 3), 1)
				+ ':' + RIGHT(run_duration, 2) AS CHAR(8))
				WHEN 4 THEN CAST('00:'
				+ LEFT(RIGHT(run_duration, 4), 2)
				+ ':' + RIGHT(run_duration, 2) AS CHAR(8))
				WHEN 5 THEN CAST('0'
				+ LEFT(RIGHT(run_duration, 5), 1)
				+ ':' + LEFT(RIGHT(run_duration, 4), 2)
				+ ':' + RIGHT(run_duration, 2) AS CHAR(8))
				WHEN 6 THEN CAST(LEFT(RIGHT(run_duration, 6), 2)
				+ ':' + LEFT(RIGHT(run_duration, 4), 2)
				+ ':' + RIGHT(run_duration, 2) AS CHAR(8))
		END AS 'MaxRunDuration'
	, CASE (d.freq_subday_interval)
				WHEN 0 THEN 'Once'
				ELSE CAST('Every '
					+ RIGHT(d.freq_subday_interval, 2)
					+ ' '
					+ CASE (d.freq_subday_type)
						WHEN 1 THEN 'Once'
						WHEN 4 THEN 'Minutes'
						WHEN 8 THEN 'Hours'
					END AS CHAR(16))
		END AS 'Hourly\Min\Once'
	,	d.ActiveEndDate	
	,	d.ActiveEndTime
	, CASE
		WHEN o.enabled = 0 THEN 'Disabled: '
		ELSE ''
		END + o.name AS 'Operator Notify'
	, o.email_address AS 'Operator Email Address'
	, CASE WHEN p.enabled = 0 THEN 'Disabled: '
		ELSE ''
		END + p.name AS 'Pager Operator Name'
	, p.email_address AS 'Pager Email Address'
	, j.date_created
	, j.date_modified
	, l.name AS 'JobOwner'
FROM msdb.dbo.sysjobs j
LEFT OUTER JOIN master.dbo.syslogins l
		ON j.owner_sid = l.sid
LEFT OUTER JOIN (SELECT
			  s.job_id
			, c.enabled
			, c.schedule_id
			, c.freq_type
			, c.freq_subday_type
			, c.freq_subday_interval
			, CASE
				WHEN s.next_run_date = 0 THEN c.active_start_date
				ELSE s.next_run_date
				END AS 'NextRunDate'
			, CASE
				WHEN s.next_run_date = 0 THEN c.active_start_time
				ELSE s.next_run_time
				END AS 'NextRunTime'
			, NULLIF(c.active_end_date, '99991231') AS 'ActiveEndDate'
			, NULLIF(c.active_end_time, '235959') AS 'ActiveEndTime'
FROM msdb.dbo.sysjobschedules s
	LEFT OUTER JOIN msdb.dbo.sysschedules c
		ON s.schedule_id = c.schedule_id) d
		ON j.job_id = d.job_id
LEFT OUTER JOIN (SELECT
				      job_id
			        , MAX(h.run_duration) AS 'run_duration'
			     FROM msdb.dbo.sysjobhistory h
				 GROUP BY job_id) Q1
		ON j.job_id = Q1.job_id
LEFT OUTER JOIN msdb.dbo.sysoperators o
		ON j.notify_email_operator_id = o.id
LEFT OUTER JOIN msdb.dbo.sysoperators p
		ON j.notify_page_operator_id = p.id
LEFT OUTER JOIN (SELECT MAX(msdb.dbo.agent_datetime(h.Run_date,h.run_time)) AS 'LastExecuted'
					, j.Name
					, j.job_id
				 FROM msdb.dbo.sysjobhistory h
					INNER JOIN msdb.dbo.sysjobs j
						ON h.job_id = j.job_id
				GROUP BY j.name, j.job_id) le
		ON le.job_id = j.job_id</Value>
                <Style>
                  <FontSize>14pt</FontSize>
                </Style>
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox1</rd:DefaultName>
        <Top>1.59667in</Top>
        <Left>0.40834in</Left>
        <Height>32.14167in</Height>
        <Width>8.23332in</Width>
        <Style>
          <Border>
            <Style>Solid</Style>
          </Border>
          <BackgroundColor>LightBlue</BackgroundColor>
          <PaddingLeft>8pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
      <Textbox Name="Textbox2">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>Job History Code</Value>
                <Style>
                  <FontSize>18pt</FontSize>
                  <Color>White</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox2</rd:DefaultName>
        <Top>0.19236in</Top>
        <Left>0.40833in</Left>
        <Height>0.425in</Height>
        <Width>8.23332in</Width>
        <ZIndex>1</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <BackgroundColor>DarkBlue</BackgroundColor>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
      <Textbox Name="Textbox4">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>Go to Main Report</Value>
                <Style>
                  <FontSize>14pt</FontSize>
                  <Color>White</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox3</rd:DefaultName>
        <ActionInfo>
          <Actions>
            <Action>
              <Drillthrough>
                <ReportName>=IIF(First(Fields!ProductMajorVersion.Value, "Version") = 10 and First(Fields!EngineEdition.Value, "ServerProperty") &lt;&gt; 5, "MainReport2008", 
IIF(First(Fields!EngineEdition.Value, "ServerProperty") = 5, Nothing, 
IIF(First(Fields!ProductMajorVersion.Value, "Version") &gt; 10 and First(Fields!EngineEdition.Value, "ServerProperty") &lt;&gt; 5, "MainReport", Nothing)))</ReportName>
              </Drillthrough>
            </Action>
          </Actions>
        </ActionInfo>
        <Top>0.6868in</Top>
        <Left>0.40833in</Left>
        <Height>0.36667in</Height>
        <Width>8.23333in</Width>
        <ZIndex>2</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <BackgroundColor>DimGray</BackgroundColor>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
      <Textbox Name="Textbox8">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>Go to Report Library</Value>
                <Style>
                  <FontSize>14pt</FontSize>
                  <Color>White</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox5</rd:DefaultName>
        <ActionInfo>
          <Actions>
            <Action>
              <Drillthrough>
                <ReportName>ReportLibrary</ReportName>
              </Drillthrough>
            </Action>
          </Actions>
        </ActionInfo>
        <Top>1.11597in</Top>
        <Left>0.40833in</Left>
        <Height>0.36667in</Height>
        <Width>3.99303in</Width>
        <ZIndex>3</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <BackgroundColor>DimGray</BackgroundColor>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
      <Textbox Name="Textbox9">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>Back to the Report</Value>
                <Style>
                  <FontSize>14pt</FontSize>
                  <Color>White</Color>
                </Style>
              </TextRun>
            </TextRuns>
            <Style>
              <TextAlign>Center</TextAlign>
            </Style>
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox6</rd:DefaultName>
        <ActionInfo>
          <Actions>
            <Action>
              <Drillthrough>
                <ReportName>JobHistory</ReportName>
              </Drillthrough>
            </Action>
          </Actions>
        </ActionInfo>
        <Top>1.11597in</Top>
        <Left>4.4708in</Left>
        <Height>0.36667in</Height>
        <Width>4.17086in</Width>
        <ZIndex>4</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <BackgroundColor>DimGray</BackgroundColor>
          <VerticalAlign>Middle</VerticalAlign>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
    </ReportItems>
    <Height>34.505in</Height>
    <Style>
      <BackgroundColor>Silver</BackgroundColor>
    </Style>
  </Body>
  <Width>9.05in</Width>
  <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
  </Page>
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="Local">
      <ConnectionProperties>
        <DataProvider>SQL</DataProvider>
        <ConnectString>Data Source=localhost;Initial Catalog=master</ConnectString>
        <IntegratedSecurity>true</IntegratedSecurity>
      </ConnectionProperties>
      <rd:SecurityType>Integrated</rd:SecurityType>
      <rd:DataSourceID>7ecfb5ec-b832-4438-ac4f-a88008146714</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="Version">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>SELECT  SERVERPROPERTY('ProductMajorversion') AS 'ProductMajorVersion'</CommandText>
      </Query>
      <Fields>
        <Field Name="ProductMajorVersion">
          <DataField>ProductMajorVersion</DataField>
          <rd:TypeName>System.Object</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="ServerName">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>Select @@servername AS 'ServerName'</CommandText>
      </Query>
      <Fields>
        <Field Name="ServerName">
          <DataField>ServerName</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="ServerProperty">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>SELECT ServerProperty('EngineEdition') AS 'EngineEdition'</CommandText>
      </Query>
      <Fields>
        <Field Name="EngineEdition">
          <DataField>EngineEdition</DataField>
          <rd:TypeName>System.Object</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
  </DataSets>
  <rd:ReportUnitType>Inch</rd:ReportUnitType>
  <rd:ReportID>43b8fe02-5dee-4b69-894e-b90a99a82453</rd:ReportID>
</Report>