‎06-29-2010 08:12 PM
Select Distinct Top 1000000 dbo.tblSoftware.softwareName As Software,
dbo.tblSoftware.softwareVersion As Version, Count(dbo.tblSoftware.SoftwareID)
As Total
From dbo.tblSoftware Inner Join
dbo.tblComputers On dbo.tblSoftware.ComputerName =
dbo.tblComputers.Computername Inner Join
dbo.web40ActiveComputers On dbo.tblComputers.Computername =
dbo.web40ActiveComputers.Computername
Where dbo.tblSoftware.SoftwarePublisher Like '%Microsoft Office%' And
dbo.tblSoftware.Installdate =
'= Cast(dbo.tblSoftware.Installdate As SmallDateTime) >= DateAdd(d, -360, GetDate())'
Group By dbo.tblSoftware.softwareName, dbo.tblSoftware.softwareVersion
Order By Count(dbo.tblSoftware.SoftwareID) Desc, dbo.tblSoftware.softwareName
Solved! Go to Solution.
‎06-29-2010 10:08 PM
‎07-14-2010 12:07 AM
SELECT
tblComputers.Computer AS [Computer]
,tblSoftware.SoftwareName AS [Name]
,CASE ISDATE(tblSoftware.InstallDate) WHEN '1' THEN CAST(tblSoftware.InstallDate AS SMALLDATETIME) END AS [InstallDate]
FROM tblComputers
RIGHT JOIN tblSoftware
ON tblComputers.ComputerName = tblSoftware.ComputerName
WHERE
tblSoftware.SoftwareName LIKE '%microsoft%office%'
AND DATEDIFF(YEAR, CASE ISDATE(tblSoftware.InstallDate) WHEN '1' THEN CAST(tblSoftware.InstallDate AS SMALLDATETIME) END, GETDATE()) < 1
‎06-29-2010 11:09 PM
‎06-29-2010 10:08 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now