...
A query can be created using the web interface if a user has a role that contains the queries::create permission. Go to menu: Manage -> Queries -> Create Queries. There is also a create button on the collection page.
View Query Details
Go to menu: Manage -> Queries -> List Queries.
...
You can also edit or delete any query.
Examples
Devices Older Than X
This example query retrieves a list of devices OVER 5 years old. The query uses today (NOW) and system.purchase_date as the reference point. You could do something similar with system.warranty_expires and look for a warranty expiration date within the next 90-days or already expired.
...