Hi, @TechUST
Sorry for the late, I just came back from vacation.
And I'm sorry I did not check the query again after I copy and paste it, it seems the code blocks have a word limit, so some words missed in the end.
It should be:
Select
name0,sud.FileName,c.name,
Case
when sud.EndTimeLocal > GETDATE()-30 then '< 1 month'
when sud.EndTimeLocal > GETDATE()-60 and sud.EndTimeLocal < GETDATE()-30 then 'betweem 1 and 2 months'
when sud.EndTimeLocal > GETDATE()-180 and sud.EndTimeLocal < GETDATE()-60 then 'betweem 2 and 6 months'
else '> 6 months'
end as 'Months Without Usage',
sud.EndTimeLocal as 'Last Usage'
from v_GS_SoftwareUsageData sud
inner join v_R_System vrs on vrs.ResourceID=sud.ResourceID
inner join v_FullCollectionMembership fcm on fcm.ResourceID = vrs.ResourceID
inner join v_Collection c on c.CollectionID = fcm.CollectionID
where sud.FileName = 'Adobe.exe'
and c.CollectionID = 'xxxxxxx'
The FileName is not the rule name, it's the file name in your metering rule like this:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.