cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shuriken101
Engaged Sweeper II
Hi Everyone,

I am looking for some assistance combining two separate reports (our dev guy is out for a month).
Rather, I need a registry value from the second report to appear in the first one, or just show blank if it doesn't exist.

One report lists PCs with AutoCAD 2016 installed, the second shows the value of a registry key.

The first report lists AutoCAD installs:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblAssets.Lastseen,
tblSoftwareUni.softwareName
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Where tblSoftwareUni.softwareName Like '%Autodesk AutoCAD 2016%' And
tblAssetCustom.State = 1

The second report lists the value of a registry key:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblState.Statename,
tblAssets.Domain,
tblRegistry.Regkey,
tblRegistry.Valuename,
tblRegistry.Value,
tblRegistry.Lastchanged
From tblAssets
Inner Join tblRegistry On tblAssets.AssetID = tblRegistry.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblRegistry.Regkey Like '%_Px_Tools' And tblAssets.Assettype = -1
Order By tblAssets.AssetName


So I just need the tblRegistry.Value to show in the first report.

I am hoping this is something very simple.

Can anyone please help?

Thanks,
Chris
1 REPLY 1
Nick_VDB
Champion Sweeper III
We have modified the initial query and added the regkey fields from the second report to it. Hopefully this is the result that you are after.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Lastseen,
tblSoftwareUni.softwareName,
RegKey.RegKey,
RegKey.Valuename,
RegKey.Value
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Left Join (Select Top 1000000 tblAssets.AssetID,
tblRegistry.Regkey As RegKey,
tblRegistry.Valuename As Valuename,
tblRegistry.Value As Value
From tblAssets
Inner Join tblRegistry On tblAssets.AssetID = tblRegistry.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblRegistry.Regkey Like '%_Px_Tools') As RegKey On tblAssets.AssetID =
RegKey.AssetID
Where tblSoftwareUni.softwareName Like '%Autodesk AutoCAD 2016%' And
tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblSoftwareUni.softwareName