Link to home
Start Free TrialLog in
Avatar of sarahs
sarahs

asked on

report in sms 2007

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.
Comments?
Thank you,
Sarah

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
SOLUTION
Avatar of jamie77777
jamie77777

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sarahs
sarahs

ASKER

jamie77777 gets the points for the comment