11-20-2012 07:39 PM
Solved! Go to Solution.
11-12-2014 10:41 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tsysOS.OSName,
tblAssets.SP,
tblAssets.IPAddress,
SoftwareCheck.softwareName,
SoftwareCheck.softwareVersion,
SoftwareCheck.SoftwarePublisher
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tsysOS ON tblAssets.OScode = tsysOS.OScode
LEFT JOIN ( SELECT
tblSoftware.AssetID,
tblSoftwareUni.softwareName,
tblSoftwareUni.SoftwarePublisher,
tblSoftware.softwareVersion
FROM
tblSoftware
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.softID
WHERE
(tblSoftwareUni.softwareName LIKE 'Microsoft Office%')
OR (tblSoftwareUni.softwareName LIKE '%lync%')
) AS SoftwareCheck ON SoftwareCheck.AssetID = tblAssets.AssetID
WHERE
tblAssetCustom.State = 1
ORDER BY
tblAssets.AssetName
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tsysOS.OSName,
tblAssets.SP,
tblAssets.IPAddress,
SoftwareCheck.softwareName,
SoftwareCheck.softwareVersion,
SoftwareCheck.SoftwarePublisher
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tsysOS ON tblAssets.OScode = tsysOS.OScode
LEFT JOIN ( SELECT
tblSoftware.AssetID,
tblSoftwareUni.softwareName,
tblSoftwareUni.SoftwarePublisher,
tblSoftware.softwareVersion
FROM
tblSoftware
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.softID
WHERE
( (tblSoftwareUni.softwareName LIKE 'Microsoft Office%')
OR (tblSoftwareUni.softwareName LIKE '%lync%')
)
AND (tblSoftwareUni.softwareName NOT LIKE '%Viewer%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Add-in%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Interop%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Live Meeting%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Web Components%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Connector%')
) AS SoftwareCheck ON SoftwareCheck.AssetID = tblAssets.AssetID
WHERE
tblAssetCustom.State = 1
ORDER BY
tblAssets.AssetName
11-12-2014 10:41 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tsysOS.OSName,
tblAssets.SP,
tblAssets.IPAddress,
SoftwareCheck.softwareName,
SoftwareCheck.softwareVersion,
SoftwareCheck.SoftwarePublisher
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tsysOS ON tblAssets.OScode = tsysOS.OScode
LEFT JOIN ( SELECT
tblSoftware.AssetID,
tblSoftwareUni.softwareName,
tblSoftwareUni.SoftwarePublisher,
tblSoftware.softwareVersion
FROM
tblSoftware
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.softID
WHERE
(tblSoftwareUni.softwareName LIKE 'Microsoft Office%')
OR (tblSoftwareUni.softwareName LIKE '%lync%')
) AS SoftwareCheck ON SoftwareCheck.AssetID = tblAssets.AssetID
WHERE
tblAssetCustom.State = 1
ORDER BY
tblAssets.AssetName
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tsysOS.OSName,
tblAssets.SP,
tblAssets.IPAddress,
SoftwareCheck.softwareName,
SoftwareCheck.softwareVersion,
SoftwareCheck.SoftwarePublisher
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tsysOS ON tblAssets.OScode = tsysOS.OScode
LEFT JOIN ( SELECT
tblSoftware.AssetID,
tblSoftwareUni.softwareName,
tblSoftwareUni.SoftwarePublisher,
tblSoftware.softwareVersion
FROM
tblSoftware
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.softID
WHERE
( (tblSoftwareUni.softwareName LIKE 'Microsoft Office%')
OR (tblSoftwareUni.softwareName LIKE '%lync%')
)
AND (tblSoftwareUni.softwareName NOT LIKE '%Viewer%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Add-in%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Interop%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Live Meeting%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Web Components%')
AND (tblSoftwareUni.softwareName NOT LIKE '%Connector%')
) AS SoftwareCheck ON SoftwareCheck.AssetID = tblAssets.AssetID
WHERE
tblAssetCustom.State = 1
ORDER BY
tblAssets.AssetName
11-10-2014 09:46 AM
11-23-2012 11:37 AM
11-21-2012 01:02 PM
11-21-2012 06:04 PM
Kreg wrote:
To show in the same query my user with office 2007, 2010.... and user without office. You think it's possible ?
Kreg wrote:
And the second point, is, is it possible in adding other applications ?
All of my users + with or without Office + with or without Lync...
Select Top 1000000 Web40OSName.Compimage As icon, tblComputers.Computername, tblComputers.Computer, tblComputers.Domain, Web40OSName.OSname As OS, Web40OSName.SP, tblComputers.LastknownIP As IP, SoftwareCheck.Software, SoftwareCheck.Version, SoftwareCheck.Publisher From tblComputers Inner Join Web40OSName On Web40OSName.Computername = tblComputers.Computername Left Join (Select tblSoftware.ComputerName, tblSoftware.softwareName As Software, tblSoftware.softwareVersion As Version, tblSoftware.SoftwarePublisher As Publisher From tblSoftware Where tblSoftware.softwareName Like 'Microsoft Office%' Or tblSoftware.softwareName Like '%lync%') SoftwareCheck On SoftwareCheck.ComputerName = tblComputers.Computername Order By tblComputers.ComputerUnique
11-21-2012 11:32 AM
Kreg wrote:
I see that I can not set up a query that will display (for example) all my machines WITH and WITHOUT 'Microsoft Office%'. > In the same query.
Select Top 1000000 Web40OSName.Compimage As icon, tblComputers.Computername, tblComputers.Computer, tblComputers.Domain, Web40OSName.OSname As OS, Web40OSName.SP, tblComputers.LastknownIP As IP, SoftwareCheck.Software, SoftwareCheck.Version, SoftwareCheck.Publisher From tblComputers Inner Join Web40OSName On Web40OSName.Computername = tblComputers.Computername Left Join (Select tblSoftware.ComputerName, tblSoftware.softwareName As Software, tblSoftware.softwareVersion As Version, tblSoftware.SoftwarePublisher As Publisher From tblSoftware Where tblSoftware.softwareName Like 'Microsoft Office%') SoftwareCheck On SoftwareCheck.ComputerName = tblComputers.Computername Order By tblComputers.ComputerUnique
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now