‎04-29-2014 06:50 PM
Solved! Go to Solution.
‎05-05-2014 07:30 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssets.Description,
tblDiskdrives.Caption,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
free,
Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) As
[total size],
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) As UsedPCT,
tblDiskdrives.Lastchanged As [last changed],
tsysOS.Image As icon
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) <> 0 And
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) > 90 And tblDiskdrives.DriveType = 3 And tblAssetCustom.State = 1
‎05-17-2014 02:33 AM
= 'LAN-001'
‎05-17-2014 01:03 AM
‎05-16-2014 06:51 PM
‎05-16-2014 11:47 PM
MikeInLa wrote:
Sorry, this is working great for us... but was just wondering if possible to only show C drives? Looking at the way this all works, it doesn't seem possible, just thought I would ask. Thanks again for the report 🙂
SELECT TOP (1000000) tblAssets.AssetID, tblAssets.AssetUnique, tsysOS.OSname, tblAssets.Description, tblDiskdrives.Caption, CAST(CAST(tblDiskdrives.Freespace AS bigint)
/ 1024 / 1024 AS numeric) AS free, CAST(CAST(tblDiskdrives.Size AS bigint) / 1024 / 1024 AS numeric) AS [total size],
CEILING((tblDiskdrives.Size - tblDiskdrives.Freespace) / (CASE tblDiskdrives.Size WHEN 0 THEN 1 ELSE tblDiskdrives.Size END) * 100) AS UsedPCT,
tblDiskdrives.Lastchanged AS [last changed], tsysOS.Image AS icon
FROM tblAssets INNER JOIN
tblDiskdrives ON tblAssets.AssetID = tblDiskdrives.AssetID INNER JOIN
tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID INNER JOIN
tsysOS ON tblAssets.OScode = tsysOS.OScode
WHERE (CAST(CAST(tblDiskdrives.Size AS bigint) / 1024 / 1024 AS numeric) <> 0) AND (CEILING((tblDiskdrives.Size - tblDiskdrives.Freespace)
/ (CASE tblDiskdrives.Size WHEN 0 THEN 1 ELSE tblDiskdrives.Size END) * 100) > 90) AND (tblDiskdrives.DriveType = 3) AND (tblAssetCustom.State = 1) AND
(tblDiskdrives.Caption LIKE N'%c%')
‎05-06-2014 02:07 AM
‎05-05-2014 07:30 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssets.Description,
tblDiskdrives.Caption,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
free,
Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) As
[total size],
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) As UsedPCT,
tblDiskdrives.Lastchanged As [last changed],
tsysOS.Image As icon
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) <> 0 And
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) > 90 And tblDiskdrives.DriveType = 3 And tblAssetCustom.State = 1
‎05-05-2014 07:09 PM
‎05-05-2014 06:59 PM
‎04-30-2014 03:06 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now