‎12-02-2019 04:42 PM
Solved! Go to Solution.
‎09-02-2021 04:52 PM
Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tblassets.IPAddress,
tsysassettypes.AssetType,
tblUps.Manufacturer,
tblUps.Model,
tblUps.Name,
Case
When tblUps.BatteryStatus = 1 Then 'Unknown'
When tblUps.BatteryStatus = 2 Then 'Normal'
When tblUps.BatteryStatus = 3 Then 'Low'
When tblUps.BatteryStatus = 4 Then 'Depleted'
End As BatteryStatus,
tblUps.EstimatedMinutesRemaining,
tblUps.UpsSoftwareVersion,
tblUps.AgentSoftwareVersion,
tblUps.EstimatedChargeRemaining,
tblassets.Lastseen,
tblassets.Lasttried,
Case
When tblUps.BatteryStatus = 3 Then '#f7f0ca'
When tblUps.BatteryStatus = 4 And tblUps.BatteryStatus = 1 Then '#ffcccc'
Else '#ccffcc'
End As backgroundcolor,
SN.Data As sn,
ca.Data As Capacity,
rr.Data As RuntimeRemaining,
ol.Data As OutputLoad,
lr.data as LastReplaced
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Inner Join lansweeperdb.dbo.tblUps On tblassets.AssetID = tblUps.AssetId
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'sn') As SN On tblassets.AssetID = SN.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'Capacity') As ca On tblassets.AssetID =
ca.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'RuntimeRemaining') As rr On tblassets.AssetID =
rr.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'OutputLoad') As ol On tblassets.AssetID =
ol.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'LastReplaced') As lr On tblassets.AssetID =
lr.AssetID
Where tblassetcustom.State = 1
‎09-02-2021 04:52 PM
Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tblassets.IPAddress,
tsysassettypes.AssetType,
tblUps.Manufacturer,
tblUps.Model,
tblUps.Name,
Case
When tblUps.BatteryStatus = 1 Then 'Unknown'
When tblUps.BatteryStatus = 2 Then 'Normal'
When tblUps.BatteryStatus = 3 Then 'Low'
When tblUps.BatteryStatus = 4 Then 'Depleted'
End As BatteryStatus,
tblUps.EstimatedMinutesRemaining,
tblUps.UpsSoftwareVersion,
tblUps.AgentSoftwareVersion,
tblUps.EstimatedChargeRemaining,
tblassets.Lastseen,
tblassets.Lasttried,
Case
When tblUps.BatteryStatus = 3 Then '#f7f0ca'
When tblUps.BatteryStatus = 4 And tblUps.BatteryStatus = 1 Then '#ffcccc'
Else '#ccffcc'
End As backgroundcolor,
SN.Data As sn,
ca.Data As Capacity,
rr.Data As RuntimeRemaining,
ol.Data As OutputLoad,
lr.data as LastReplaced
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Inner Join lansweeperdb.dbo.tblUps On tblassets.AssetID = tblUps.AssetId
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'sn') As SN On tblassets.AssetID = SN.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'Capacity') As ca On tblassets.AssetID =
ca.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'RuntimeRemaining') As rr On tblassets.AssetID =
rr.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'OutputLoad') As ol On tblassets.AssetID =
ol.AssetID
Left Join (Select tblassets.AssetID,
tbloiddata.Label,
tbloiddata.Data
From tblassets
Inner Join tbloiddata On tblassets.AssetID = tbloiddata.AssetID
Where tbloiddata.Label Like 'LastReplaced') As lr On tblassets.AssetID =
lr.AssetID
Where tblassetcustom.State = 1
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now