Solved

report in sms 2007

Posted on 2011-03-15
3
432 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
Comment Utility
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
Comment Utility
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
Comment Utility
jamie77777 gets the points for the comment
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Know what services you can and cannot, should and should not combine on your server.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now