I have a report that has the following sql info, it pulls data but I want to make sure I'm not missing something here. I am looking for files on 2 servers, pst files, files that are within 5 days of the current date. Using gs-softwarefile and the modified date.
I see in other research they say to use the WHERE clause with the date search but if I put in where instead of AND it returns an error when I try to save the statement.
select SYS.Netbios_Name0, SF.FileName, SF.FileSize, SF.FilePath, SF.ModifiedDate
From v_GS_SoftwareFile SF
join v_R_System SYS on SYS.ResourceID = SF.ResourceID
Where SF.FileName LIKE '%.pst' and (SYS.Netbios_Name0 LIKE 'dotscn21' or SYS.Netbios_Name0 LIKE 'dotscn20') and (DATEDIFF(day, SF.ModifiedDate, GetDate()) < 5)
ORDER BY SF.FileSize