‎03-19-2013 05:12 PM
Solved! Go to Solution.
‎03-22-2013 06:09 PM
Select Top 1000000 SubQuery.Username,
SubQuery.Domain As Userdomain,
SubQuery.LastLogon,
tblAssets.AssetName,
tblAssets.Domain
From tblCPlogoninfo
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
tblCPlogoninfo.logontime = SubQuery.LastLogon
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
‎08-12-2016 09:28 PM
Select Top 1000000 SubQuery.Username,
SubQuery.Domain As Userdomain,
SubQuery.LastLogon,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.Image As icon,
Round((Cast((DateDiff(mm, tblBIOS.ReleaseDate, GetDate())) As float) / 12),
0) As [PC Age],
tsysOS.OSname As OS,
Cast(Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 / 1024 As
numeric) As nvarchar) As [Disk size],
Cast(Cast(Cast(tblAssets.Memory As bigint) / 1024 As numeric) As nvarchar) As
RAM,
tblAssets.NrProcessors As #CPU,
tblAssets.Processor,
tblAssetCustom.Serialnumber As Serial,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssets.IPAddress As [IP Address],
tblAssets.AssetID
From tblCPlogoninfo
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
tblCPlogoninfo.logontime = SubQuery.LastLogon
Left Join tblADUsers ON tblADUsers.Userdomain = SubQuery.Domain AND tblADUsers.Username = SubQuery.Username
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Where tblDiskdrives.Caption = 'c:' And tblAssetCustom.State = 1
And tblADUsers.OU Not Like '%Disabled Users%'
Order By Userdomain
‎11-15-2013 03:33 PM
‎11-15-2013 02:48 PM
Select Top 1000000 SubQuery.Username,
SubQuery.Domain As Userdomain,
SubQuery.LastLogon,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.Image As icon,
Round((Cast((DateDiff(mm, tblBIOS.ReleaseDate, GetDate())) As float) / 12),
0) As [PC Age],
tsysOS.OSname As OS,
Cast(Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 / 1024 As
numeric) As nvarchar) As [Disk size],
Cast(Cast(Cast(tblAssets.Memory As bigint) / 1024 As numeric) As nvarchar) As
RAM,
tblAssets.NrProcessors As #CPU,
tblAssets.Processor,
tblAssetCustom.Serialnumber As Serial,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssets.IPAddress As [IP Address],
tblAssets.AssetID
From tblCPlogoninfo
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
tblCPlogoninfo.logontime = SubQuery.LastLogon
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Where tblDiskdrives.Caption = 'c:' And tblAssetCustom.State = 1
Order By Userdomain
‎08-08-2016 09:53 PM
Lansweeper wrote:
You should link to tblAssets the same way as in your current report. Try:Select Top 1000000 SubQuery.Username,
SubQuery.Domain As Userdomain,
SubQuery.LastLogon,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.Image As icon,
Round((Cast((DateDiff(mm, tblBIOS.ReleaseDate, GetDate())) As float) / 12),
0) As [PC Age],
tsysOS.OSname As OS,
Cast(Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 / 1024 As
numeric) As nvarchar) As [Disk size],
Cast(Cast(Cast(tblAssets.Memory As bigint) / 1024 As numeric) As nvarchar) As
RAM,
tblAssets.NrProcessors As #CPU,
tblAssets.Processor,
tblAssetCustom.Serialnumber As Serial,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssets.IPAddress As [IP Address],
tblAssets.AssetID
From tblCPlogoninfo
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
tblCPlogoninfo.logontime = SubQuery.LastLogon
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Where tblDiskdrives.Caption = 'c:' And tblAssetCustom.State = 1
Order By Userdomain
‎11-14-2013 08:43 PM
‎03-22-2013 06:09 PM
Select Top 1000000 SubQuery.Username,
SubQuery.Domain As Userdomain,
SubQuery.LastLogon,
tblAssets.AssetName,
tblAssets.Domain
From tblCPlogoninfo
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
Max(tblCPlogoninfo.logontime) As LastLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
tblCPlogoninfo.logontime = SubQuery.LastLogon
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
‎03-21-2013 11:20 AM
‎03-21-2013 11:15 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now