Last date used metering Interval
I am trying to adjust the code below to show me what processes haven't been used in 30 days. Can anyone tell me what is wrong with what is below. It is from the inkPad news letters and other bits from here. I just need it to show what processes from metering haven't been used in 30 days.
SELECT COUNT(SMD.ID) as "Launches",
SUM(SECONDS_USED)/360 as "Time Used (hours)",
MAX(END) as "Last Used",
MACHINE.NAME as "Computer",
GROUP_CONCAT(DISTINCT(USER_DATA)) AS "Users"
FROM ORG1.SAM_METER_DATA SMD
JOIN MACHINE on SMD.MACHINE_ID = MACHINE.ID
JOIN SAM_VIEW_TITLED_SOFTWARE SVTS on SMD.TITLED_APPLICATION_ID = SVTS.ID
and END > DATE_SUB(NOW(),INTERVAL 1 Day)
GROUP BY TITLED_APPLICATION_ID, MACHINE_ID
ORDER BY Launches DESC
Be the first to answer this question