→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎09-20-2013 06:30 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
TsysChassisTypes.ChassisName,
tblAssetCustom.Serialnumber,
tblNetwork.MACaddress,
tsysOS.OSname As OS,
tsysOS.Image As icon,
tblAssets.Processor As CPU,
tblComputersystem.NumberOfLogicalProcessors As Cores,
Replace(Replace(tblAssetCustom.PurchaseDate, '00:00:00', ''), '12:00AM',
'') As [Purchase Date],
Replace(Replace(tblAssetCustom.Warrantydate, '00:00:00', ''), '12:00AM',
'') As [Warrenty EXP Date],
tblADComputers.OU As Dept,
tblState.Statename,
tblAssets.Lastseen
From tblAssets
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Inner Join TsysChassisTypes On TsysChassisTypes.Chassistype =
tblSystemEnclosure.ChassisTypes
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblAssetCustom.Model <> 'Virtual Machine' And tblNetwork.IPEnabled = 1 And
tblComputersystem.Domainrole = 1
Order By tblAssets.AssetName
Solved! Go to Solution.
‎09-23-2013 06:23 PM
‎09-25-2013 07:06 PM
‎09-25-2013 11:24 AM
feffrey wrote:
is there a way to change that they are still on the report, but it is blank for the user?
‎09-25-2013 12:00 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
SubQuery3.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
TsysChassisTypes.ChassisName,
tblAssetCustom.Serialnumber,
tblNetwork.MACaddress,
tsysOS.OSname As OS,
tsysOS.Image As icon,
tblAssets.Processor As CPU,
tblComputersystem.NumberOfLogicalProcessors As Cores,
tblAssets.Memory,
tblADComputers.OU As Dept,
Replace(Replace(tblAssetCustom.PurchaseDate, '00:00:00', ''), '12:00AM',
'') As [Purchase Date],
Replace(Replace(tblAssetCustom.Warrantydate, '00:00:00', ''), '12:00AM',
'') As [Warrenty EXP Date],
tblState.Statename,
tblAssets.Lastseen
From tblAssets
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Inner Join TsysChassisTypes On TsysChassisTypes.Chassistype =
tblSystemEnclosure.ChassisTypes
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join (Select Top 1000000 tblAssets.AssetID,
Max(SubQuery1.Logins) As MaxLogins
From tblAssets
Inner Join (Select Top 1000000 tblAssets.AssetID,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username,
Count(tblCPlogoninfo.ID) As Logins
From tblAssets
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Where tblCPlogoninfo.logontime > GetDate() - 30
Group By tblAssets.AssetID,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Group By tblAssets.AssetID) SubQuery2 On SubQuery2.AssetID = tblAssets.AssetID
Inner Join (Select Top 1000000 tblAssets.AssetID,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username,
Count(tblCPlogoninfo.ID) As Logins
From tblAssets
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Where tblCPlogoninfo.logontime > GetDate() - 30
Group By tblAssets.AssetID,
tblCPlogoninfo.Domain,
tblCPlogoninfo.Username) SubQuery3 On SubQuery3.AssetID = SubQuery2.AssetID
And SubQuery3.Logins = SubQuery2.MaxLogins
Where tblAssetCustom.Model <> 'Virtual Machine' And tblNetwork.IPEnabled = 1 And
tblComputersystem.Domainrole = 1
Order By tblAssets.AssetName
‎03-26-2020 05:20 PM
‎09-23-2013 06:23 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now