Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Quering SysJobs tables for Job details

    use the below query u ll get 1 record for each job.

    select max(lastrun),name from(

    SELECT distinct j.[name],

    MAX(CAST(

    STUFF(STUFF(CAST(jh.run_date as varchar),7,0,'-'),5,0,'-') + ' ' +

    STUFF(STUFF(REPLACE(STR(jh.run_time,6,0),' ','0'),5,0,':'),3,0,':') as datetime)) AS [LastRun],

    CASE jh.run_status...

Viewing post 1 (of 1 total)