‎11-18-2014 04:57 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.Domain,
tblAssets.AssetName,
tsysOS.OSname As OS,
tblUptime.EventTime,
Case tblUptime.EventType When 1 Then 'power on' When 2 Then 'power off'
When 3 Then 'Start sleep' When 4 Then 'End sleep'
When 5 Then 'Unexpected shutdown' End As Event,
tblAssets.Lastseen,
tsysOS.Image As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblUptime On tblAssets.AssetID = tblUptime.AssetId
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblUptime.EventTime > GetDate() - 7 And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblUptime.EventTime Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now