TblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username = Max(tblCPlogoninfo.logontime) As LastLogon Inner Join (Select Top 1000000 tblCPlogoninfo.Username, Where tblDiskdrives.Caption = 'c:' And tblAssetCustom.State = 1 Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID Join tsysOS On tblAssets.OScode = tsysOS.OScode Left Outer Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID Round((Cast((DateDiff(mm, tblBIOS.ReleaseDate, GetDate())) As float) / 12),Ĭast(Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 / 1024 AsĬast(Cast(Cast(tblAssets.Memory As bigint) / 1024 As numeric) As nvarchar) As Select Top 1000000 tblAssets.Username As Username, I would like the report to show the last pc a user signed into along with the info above. My report shows a list of assets with the last user that signed in. Here is the code that I made to gather the info I need. I would like to link the tables that provide the following information. I like the Basic report above, but I am having trouble adding other tables.
#Lansweeper last logon report update#
The Last Left Join is what you are after, just update the report to contain the information you want to return above the Joins & From. ) AS LogonInfo on AssetInfo.Assetname = LogonInfo.Assetname Left Join dbo.tblSystemEnclosure SYSEN On ASSETS.AssetID = SYSEN.AssetID Left Join dbo.tblOperatingSystem ASOP On ASSETS.AssetID = ASOP.AssetID Left Join dbo.tblAssetCustom ASCUST On ASSETS.AssetID = ASCUST.AssetID Left Join dbo.tblADComputers COMP on ASSETS.AssetID = COMP.AssetID ,ASOP.ServicePackMajorVersion as OperatingSystemServicePack Select top 100 percent AssetInfo.AssetName