Asset Management Suite

 View Only
  • 1.  Does anyone have a report to show the date of an asset status change?

    Posted Nov 22, 2016 04:49 PM

    I am looking specifically for a report that shows me the date an asset was changed to retired.

     

    So essentially if I can run a report it would either show me all retired assets and the date they were retired, or even better a report that I can run daily that would show me assets that were changed to retired in the past 24 hours or past day.

     



  • 2.  RE: Does anyone have a report to show the date of an asset status change?
    Best Answer

    Posted Nov 23, 2016 02:58 PM

    I use the following in an Automation policy that gets sent out every day. I am sure you can (if not I can help) change it to only show Retired. Right now it will do all statuses.

     

    select --vri.Guid,
    	vri.name,
    	i.name 'Asset Type',
    	ins.name 'New Value',
    	del.name 'Old Value',
    	ins.ChangeDate,
    	a.UserId
    from vResourceItem vri
    inner join (
    	select ParentResourceGuid,
    		ChildResourceGuid,
    		ChangeType,
    		ChangeDate,
    		name
    	from ResourceAssociationHistoryDelta
    	inner join Item
    		on Guid = ChildResourceGuid
    	where ResourceAssociationTypeGuid = '3028166F-C0D6-41D8-9CB7-F64852E0FD01'
    		and ChangeType = 'I'
    		and datediff(HOUR, [ChangeDate], getdate()) < 24
    	) ins
    	on ins.ParentResourceGuid = vri.Guid
    inner join (
    	select ParentResourceGuid,
    		ChildResourceGuid,
    		ChangeType,
    		ChangeDate,
    		name
    	from ResourceAssociationHistoryDelta
    	inner join Item
    		on Guid = ChildResourceGuid
    	where ResourceAssociationTypeGuid = '3028166F-C0D6-41D8-9CB7-F64852E0FD01'
    		and ChangeType = 'D'
    		and datediff(HOUR, [ChangeDate], getdate()) < 24
    	) del
    	on del.ParentResourceGuid = vri.Guid
    inner join Item i
    	on i.Guid = vri.ResourceTypeGuid
    left join Inv_Audit a
    	on (
    			a._ResourceGuid = ins.ParentResourceGuid
    			and a.AuditDate = ins.ChangeDate
    			)
    where ins.ChangeDate = del.ChangeDate
    order by ins.ChangeDate,
    	i.name
    

     



  • 3.  RE: Does anyone have a report to show the date of an asset status change?

    Posted Dec 14, 2016 11:09 AM

    Thanks this report is perfect.  I actually like it better showing all changes like you have, but if my management only wants retired still I can make the modifications based on the query you have provided me.

     

    Thanks agian