SELECT
b.Netbios_Name0,
b.User_Name0,
CASE
WHEN a.FileVersion LIKE '11.%' THEN 'Office 2003'
WHEN a.FileVersion LIKE '12.%' THEN 'Office 2007'
WHEN a.FileVersion LIKE '14.%' THEN 'Office 2010'
ELSE 'Udda Version' END AS 'Office Version',
a.FileName,
a.FileVersion,
a.FilePath
FROM
v_GS_SoftwareFile a
JOIN v_R_System b ON a.ResourceID = b.ResourceID
JOIN v_RA_System_SystemOUName c ON a.ResourceID = c.ResourceID
WHERE FileName = 'outlook.exe'
AND (
c.System_OU_Name0 LIKE 'groupinfra.com/Corporate/Landlord SE/SE/Computers%'
OR
c.System_OU_Name0 LIKE 'groupinfra.com/Corporate/Landlord SE/DK/Computers%'
OR
c.System_OU_Name0 LIKE 'groupinfra.com/Corporate/Landlord SE/FI/Computers%'
OR
c.System_OU_Name0 LIKE 'groupinfra.com/Corporate/Landlord SE/NO/Computers%'
)
GROUP BY
b.Netbios_Name0,
b.User_Name0,
a.FileName,
a.FileVersion,
a.FilePath
ORDER BY
b.Netbios_Name0