I have been working on a SQL script that will pull the monthly average volume utilisation of a selected node for the past 6 months. What I have so far only covers a single month by matching the timestamp and I can't work out how to cover multiple months in the same script.
SELECT vd.[NodeID],vd.VolumeID,v.volumedescription
,ROUND((AVG(vd.DiskSize)/1024/1024/1024),0) AS SizeGB
,ROUND((AVG(vd.AvgDiskUsed)/1024/1024/1024),0) AS UsedGB
FROM [SolarWindsOrion].[dbo].[VolumeUsage_CS_Daily_hist] vd
INNER JOIN Volumes v on v.volumeid = vd.volumeid
WHERE
TIMESTAMP like '2024-12%' and
v.volumetype='Fixed Disk'
AND vd.NODEID=[xxxx]
GROUP BY vd.VolumeID,vd.NodeID,vd.DiskSize,v.volumedescription
I know this can be done in NPM reports but I intend to use the data in SQL Reporting
If anyone could point me in the right direction, it would be much appreciated.
Thanks