Your company's ad could live here and reach over 50,000 people a month!

Share This Post

Lists people and how much they’ve been using specified software

For full details see: https://myitforum.com/forums/Need-some-SQL-help-think-its-simple-m234978.aspx

 

select 
  U.Name0 as 'Bruger', 
--  U.displayName0 as 'Bruger', 
  MU.FullName as 'Brugernavn', 
  replace(max(ou.User_OU_Name0),'ITCSYD.LOCAL/BRUGERE/','') as OU, 
  round(sum(MUS.UsageTime)/60.0,2) as 'Forbrug (min)' 
from 
  dbo.v_R_System R
  join dbo.v_MonthlyUsageSummary MUS on R.ResourceID = MUS.ResourceID 
  join dbo.v_MeteredFiles MF on MUS.FileID = MF.MeteredFileID 
  join dbo.v_MeteredUser MU on MUS.MeteredUserID = MU.MeteredUserID 
  join dbo.v_R_User U on U.Unique_User_Name0 = MU.FullName 
  left join v_RA_User_UserOUName ou on ou.ResourceID = U.ResourceID 
where 
  MF.ProductName = @RuleName 
Group by 
  U.Name0,
  MU.FullName, 
  ou.ResourceID 
 order by  
  U.Name0


Share This Post

Leave a Reply