Count of Device by AD site

Select B.ADSite as ‘AD Site’, Count(B.ADSite) as ‘Count’
from
(SELECT
  Case
   When R.AD_Site_Name0 = ” Then ‘<No AD Site>’
   When R.AD_Site_Name0 = NULL Then ‘<No AD Site>’
   When isnull(R.AD_Site_Name0,’one’) = ‘one’ Then ‘<No AD Site>’
   else  R.AD_Site_Name0
  End as ‘ADSite’–,
FROM v_R_System R) as B
Group by
B.ADSite
Order by
B.ADSite

Leave a Reply

Your email address will not be published. Required fields are marked *