Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Dynamic Collection Creation

Dynamic Collection Creation

Dynamic Collection Creation

I am trying to create a colletion that will update once a month.
The member of this collection will be pcs that haven`t run metered application "XX" for at least 90 days.
I am able to do this if I statically put the date in the criteria of the collection, but was wondering if there was a way to have the 90 day rule in the criteria.
I am having no luck finding an answer, and was hoping that maybe someone had done this before...

RE: Dynamic Collection Creation

When looking at your query inside the collection, click "Show Query Language".  Your criteria date, change to something like this:

and datediff(day,SMS_G_SYSTEM_WORKSTATION_STATUS.LastHardwareScan,getdate()) < "30"

This example is for the Last Hardware Inventory scan date, but you should be able to use it in your query as a guide.  Note once you do this, you won't be able to go back to "Show Query Design"; but it works anyway.

RE: Dynamic Collection Creation

Can you post an example from one of your collections?  I have tried adding that line and each time it doesn't like the query statement.  It lets me click OK once "while leaving it on Show Query Design" but it doesn't allow me to go further.  Thanks.

RE: Dynamic Collection Creation

Here's one "All XP workstations, HW INV last 30 days"

select SMS_R_System.ResourceID, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System  inner join SMS_G_System_WORKSTATION_STATUS on SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId  where OperatingSystemNameandVersion = "Microsoft Windows NT Workstation 5.1" and datediff(day,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,getdate()) <= "30"

Blog: http://myitforum.com/cs2/blogs/skissinger/

RE: Dynamic Collection Creation

Thanks so much.  It worked great!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close