Video Screencast Help

SQL query help

Created: 25 Apr 2013

Hi,

I am running altiris 7.1 version,

For task failure reports, I have a an existing sql query that will list what are all nodes that failed.

Issue is , I schedued this job twice a day. Now the failure report also showing the job failed 2 times. I need help on getting the latest record for that node instead of showing 2 records. Any help is appreciated. I am attaching the existing sql query.

select distinct
     vc.Name,
     it.Name as Task,
     eti.Result,
     eti.Success,
     eti.EndTime
            
from Evt_Task_Instances eti

join  ItemVersions iv
     on eti.TaskVersionGuid = iv.VersionGuid
join vItem it
     on it.Guid = iv.ItemGuid
join vComputer vc
     on vc.Guid = eti._ResourceGuid
join dbo.CollectionMembership cm
     on vc.Guid = cm.ResourceGuid
where
eti.EndTime >=replace(convert(varchar,getdate()-1,111),'/','-')  +' 22:00:00.000'
and eti.EndTime is not null
and eti.Result = 1
and
(it.Name ='Execute install command for Job NameXX1'
or it.Name ='Execute install command for Job NameXX2'
)

order by
     vc.Name,
     it.Name

Operating Systems: