Utilizing the Date and Time Functions in WQL Queries

There will be many occasions when applying a date filter to your query will be quite useful. For example, when creating queries, it is often helpful to know that the information retrieved is the most current available. Pulling changes to hardware inventory that occurred sometime in the last week is a likely scenario. ConfigMgr queries support the use of the following functions:

DateAdd(): Returns a specified date value with a specified interval added to it.

DateAdd ( datepart, number, date )

Datepart: Parameter that specifies the portion of the date to add the number to.

Number: An integer value added to the specified datepart.

Date: The initial date value to add the integer to.

Here’s ...

Get System Center 2012 Configuration Manager Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.