‎03-19-2013 04:10 PM
Solved! Go to Solution.
‎04-18-2013 08:26 PM
Select Distinct Top (1000000) tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
Case tblSoftwareHist.Action When '1' Then '+' When '2' Then '-' End As [+/-],
SubQuery.softwareName,
SubQuery.SoftwarePublisher,
SubQuery.softwareVersion,
tblSoftwareHist.Lastchanged
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSoftwareHist On tblSoftwareHist.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftwareHist.softid
Inner Join (Select Top (1000000) Count(tblSoftwareHist_1.softid) As Count,
tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101) As Changed
From tblSoftwareHist As tblSoftwareHist_1
Inner Join tblSoftwareUni As tblSoftwareUni_1 On tblSoftwareUni_1.SoftID =
tblSoftwareHist_1.softid
Group By tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101)
Having Count(tblSoftwareHist_1.softid) = 1) As SubQuery
On SubQuery.softwareName = tblSoftwareUni.softwareName And
SubQuery.SoftwarePublisher = tblSoftwareUni.SoftwarePublisher And
SubQuery.softwareVersion = tblSoftwareHist.softwareVersion And
SubQuery.AssetID = tblSoftwareHist.AssetID
Where tblSoftwareHist.Lastchanged > GetDate() - 1 And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblSoftwareHist.Lastchanged Desc
‎04-18-2013 08:51 PM
‎04-18-2013 08:26 PM
Select Distinct Top (1000000) tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
Case tblSoftwareHist.Action When '1' Then '+' When '2' Then '-' End As [+/-],
SubQuery.softwareName,
SubQuery.SoftwarePublisher,
SubQuery.softwareVersion,
tblSoftwareHist.Lastchanged
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSoftwareHist On tblSoftwareHist.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftwareHist.softid
Inner Join (Select Top (1000000) Count(tblSoftwareHist_1.softid) As Count,
tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101) As Changed
From tblSoftwareHist As tblSoftwareHist_1
Inner Join tblSoftwareUni As tblSoftwareUni_1 On tblSoftwareUni_1.SoftID =
tblSoftwareHist_1.softid
Group By tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101)
Having Count(tblSoftwareHist_1.softid) = 1) As SubQuery
On SubQuery.softwareName = tblSoftwareUni.softwareName And
SubQuery.SoftwarePublisher = tblSoftwareUni.SoftwarePublisher And
SubQuery.softwareVersion = tblSoftwareHist.softwareVersion And
SubQuery.AssetID = tblSoftwareHist.AssetID
Where tblSoftwareHist.Lastchanged > GetDate() - 1 And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblSoftwareHist.Lastchanged Desc
‎04-18-2013 08:22 PM
‎04-18-2013 08:10 PM
Select Top (1000000) tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
Case tblSoftwareHist.Action When '1' Then '+' When '2' Then '-' End As [+/-],
SubQuery.softwareName,
SubQuery.SoftwarePublisher,
SubQuery.softwareVersion,
tblSoftwareHist.Lastchanged
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSoftwareHist On tblSoftwareHist.AssetID = tblAssets.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftwareHist.softid
Inner Join (Select Top (1000000) Count(tblSoftwareHist_1.softid) As Count,
tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101) As Changed
From tblSoftwareHist As tblSoftwareHist_1
Inner Join tblSoftwareUni As tblSoftwareUni_1 On tblSoftwareUni_1.SoftID =
tblSoftwareHist_1.softid
Group By tblSoftwareHist_1.AssetID,
tblSoftwareUni_1.softwareName,
tblSoftwareHist_1.softwareVersion,
tblSoftwareUni_1.SoftwarePublisher,
Convert(nvarchar,tblSoftwareHist_1.Lastchanged,101)
Having Count(tblSoftwareHist_1.softid) = 1) As SubQuery
On SubQuery.softwareName = tblSoftwareUni.softwareName And
SubQuery.SoftwarePublisher = tblSoftwareUni.SoftwarePublisher And
SubQuery.softwareVersion = tblSoftwareHist.softwareVersion And
SubQuery.AssetID = tblSoftwareHist.AssetID
Where tblSoftwareHist.Lastchanged > GetDate() - 1 And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblSoftwareHist.Lastchanged Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now