I'm trying to run a SQL query for the last time a specific application was run on specific machines. However, I keep getting multiple variations of the Name of the workstation.
Basically, I'm looking for when was the last (most recent) time an application was run by workstation. Here's what I have so far:
SELECT Name0, ProductName0, LastUsedTime0
FROM
v_GS_CCM_RECENTLY_USED_APPS, v_GS_SYSTEM
WHERE ProductName0 like '%APPNAME%'
GROUP BY Name0, ProductName0, LastUsedTime0
ORDER BY Name0
How can I get distinct Name0 fields so that I only get the last time it was run on each machine? And I only need the most recent date, not every time it was run.
I'm going straight to the DB because Software Metering was just turned on, but we need data as far back as we can go.
Any help would be MUCH preferred.
Thanks!