Query Assets added by month
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!
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