Newbie here looking to build a report that states whether File1 or File2 exists, and there needs to be one record (line) per computer.
The code below results in one record for those with neither file, and two records if both exist, where File1 or File2 column will say Yes, and the other says No.
What am I doing wrong?
SELECT DISTINCT
vrs.Netbios_Name0,
CASE WHEN Files.Filename = 'File1' THEN 'Yes'
ELSE 'No'
END AS 'File1 Exists?',
CASE WHEN Files.Filename = 'File2' THEN 'Yes'
ELSE 'No'
END as 'File2 Exists?'
FROM v_R_System AS vrs
LEFT JOIN v_GS_SoftwareFile as Files on Files.ResourceID = vrs.ResourceId