cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Glennmdh
Engaged Sweeper II
this is what I have and want to add total uptime since last reboot.

Select Top 1000000 tsysIPLocations.IPLocation As IPLocation,
tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssetCustom.Manufacturer As Vendor,
tblAssetCustom.Model,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Memory,
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As VirtualCheck,
VMWare.Hostname As [VMware Host],
HyperV.Hostname As [HyperV Host]
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join tblVmwareGuestNetwork On tblVmwareGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblVmwareGuest On tblVmwareGuest.GuestID =
tblVmwareGuestNetwork.GuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblVmwareGuest.AssetID
Where tblAssets1.AssetName Is Not Null) VMWare On VMWare.AssetID =
tblAssets.AssetID
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join TblHyperVGuestNetwork On TblHyperVGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblHyperVGuest On tblHyperVGuest.hypervguestID =
TblHyperVGuestNetwork.HyperVGuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblHyperVGuest.AssetID
Where tblAssets1.AssetName Is Not Null) HyperV On HyperV.AssetID =
tblAssets.AssetID
Left Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
The uptime is stored in tblAssets.Uptime.
Instructions for running reports can be found here. If you are interested in building or modifying reports, we would recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Updating to Lansweeper 5.3, if you haven't already. Lansweeper 5.3 includes a database dictionary, which is linked at the top of the report builder. The dictionary explains in great detail what each table and field stores.


Select Top 1000000 tsysIPLocations.IPLocation As IPLocation,
tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssetCustom.Manufacturer As Vendor,
tblAssetCustom.Model,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Memory,
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As VirtualCheck,
VMWare.Hostname As [VMware Host],
HyperV.Hostname As [HyperV Host],
tblAssets.Uptime
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join tblVmwareGuestNetwork On tblVmwareGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblVmwareGuest On tblVmwareGuest.GuestID =
tblVmwareGuestNetwork.GuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblVmwareGuest.AssetID
Where tblAssets1.AssetName Is Not Null) VMWare On VMWare.AssetID =
tblAssets.AssetID
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join TblHyperVGuestNetwork On TblHyperVGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblHyperVGuest On tblHyperVGuest.hypervguestID =
TblHyperVGuestNetwork.HyperVGuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblHyperVGuest.AssetID
Where tblAssets1.AssetName Is Not Null) HyperV On HyperV.AssetID =
tblAssets.AssetID
Left Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
The uptime is stored in tblAssets.Uptime.
Instructions for running reports can be found here. If you are interested in building or modifying reports, we would recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Updating to Lansweeper 5.3, if you haven't already. Lansweeper 5.3 includes a database dictionary, which is linked at the top of the report builder. The dictionary explains in great detail what each table and field stores.


Select Top 1000000 tsysIPLocations.IPLocation As IPLocation,
tblAssetCustom.AssetID,
tblAssets.AssetUnique,
tblAssetCustom.Manufacturer As Vendor,
tblAssetCustom.Model,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Memory,
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As VirtualCheck,
VMWare.Hostname As [VMware Host],
HyperV.Hostname As [HyperV Host],
tblAssets.Uptime
From tblAssetCustom
Inner Join tblAssets On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join tblVmwareGuestNetwork On tblVmwareGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblVmwareGuest On tblVmwareGuest.GuestID =
tblVmwareGuestNetwork.GuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblVmwareGuest.AssetID
Where tblAssets1.AssetName Is Not Null) VMWare On VMWare.AssetID =
tblAssets.AssetID
Left Join (Select Top 1000000 tblAssetMacAddress.AssetID,
tblAssets1.AssetName As Hostname
From tblAssetMacAddress
Left Join TblHyperVGuestNetwork On TblHyperVGuestNetwork.MacAddress =
tblAssetMacAddress.Mac
Left Join tblHyperVGuest On tblHyperVGuest.hypervguestID =
TblHyperVGuestNetwork.HyperVGuestID
Left Join tblAssets tblAssets1 On tblAssets1.AssetID =
tblHyperVGuest.AssetID
Where tblAssets1.AssetName Is Not Null) HyperV On HyperV.AssetID =
tblAssets.AssetID
Left Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now