/build/static/layout/Breadcrumb_cap_w.png

Query Assets added by month

Hello!

Could anyone with some basic SQL knowledge provide some guidance on how I could enter in a report query for assets added month to month?

I'd like to be able to visualize all assets (hardware) that are entered into Kace for any specific month to be able to provide to our Finance team as an excel sheet for more efficient data tracking, based on the asset creation date.

Seems easy enough, but my SQL scripting know-how is pretty non-existent. Thanks for any help!


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Hobbsy 4 years ago
Red Belt
1

First you need to be aware, although you probably already are, you cannot enter date details into a report on the fly, so you either need to be specific in your date range or create a report that says Assets added this month and run the report on a schedule to get the data.


 SELECT ASSET_TYPE.NAME, ASSET.NAME, ASSET.CREATED

FROM ASSET    ASSET

     INNER JOIN ASSET_TYPE ASSET_TYPE

        ON (ASSET.ASSET_TYPE_ID = ASSET_TYPE.ID)

WHERE (((TIMESTAMP(ASSET.CREATED) <= NOW() AND TIMESTAMP(ASSET.CREATED) > DATE_SUB(NOW(),INTERVAL 1 MONTH))))  ORDER BY ASSET.NAME


That should show you all Assets created in the last month, but you may want to also filter on the asset type


Comments:
  • Thank you Hobbsy! This works! I get a list of assets that were added.. but this leads me to another question. Is it possible to specify more data to be provided? The list it generated provides me the asset name, created date and asset type. Can more fields get added to this? - RelVlad 4 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ