→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎05-27-2015 04:57 PM
Solved! Go to Solution.
‎05-27-2015 10:50 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
Event7023.LatestTimeGenerated
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN (SELECT
tblNTLog.AssetID,
Max(tblNTLog.TimeGenerated) AS LatestTimeGenerated
FROM
tblNTLog
INNER JOIN tblNtlogSource ON tblNtlogSource.SourcenameID = tblNtlog.SourcenameID
WHERE
tblNtlog.Eventcode = '7023'
AND tblNtlogSource.Sourcename = 'Service Control Manager'
GROUP BY
tblNTLog.AssetID) AS Event7023 ON Event7023.AssetID = tblAssets.AssetID
WHERE
State = 1
‎05-28-2015 02:49 PM
‎05-27-2015 10:50 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
Event7023.LatestTimeGenerated
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN (SELECT
tblNTLog.AssetID,
Max(tblNTLog.TimeGenerated) AS LatestTimeGenerated
FROM
tblNTLog
INNER JOIN tblNtlogSource ON tblNtlogSource.SourcenameID = tblNtlog.SourcenameID
WHERE
tblNtlog.Eventcode = '7023'
AND tblNtlogSource.Sourcename = 'Service Control Manager'
GROUP BY
tblNTLog.AssetID) AS Event7023 ON Event7023.AssetID = tblAssets.AssetID
WHERE
State = 1
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now