Solved

report in sms 2007

Posted on 2011-03-15
3
448 Views
Last Modified: 2013-11-21
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
0
Comment
Question by:sarahs
  • 2
3 Comments
 

Assisted Solution

by:jamie77777
jamie77777 earned 50 total points
ID: 35176535
Hi Sarah, am finding it hard to get what you're asking.

You're query appears to work fine as you have it.  In regards to 'but if I put in where instead of AND it returns...'. you can only have one WHERE in the statement, unless you start 'sub-querying', which i don't see any value in.
0
 

Accepted Solution

by:
sarahs earned 0 total points
ID: 35180219
Thanks for the input, it seems to be an issue with the amount of data that is being inventoried to start with.  The query is working fine, but thank you for the input.

Sarah
0
 

Author Closing Comment

by:sarahs
ID: 35221124
jamie77777 gets the points for the comment
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question