Hello,
I'm trying to sort out only the Microsoft office software that are older than Office 2003 SP3 (this one must not be included, SP1, SP2 is okay to be in the list).
Here's what I have so far (sorted by Software), I'll add a few other criterias later, such as the user the OU but anyway... here's my problem/question.
I would like to reduce the number of lines for my code and I'm so not a pro in SQL...
Is there a way to have a search with this:
Where tblSoftware.softwareName Like 'Microsoft Office 2000%' Or 'Microsoft Office XP&' Or '....' and so on ?
Because right now I'm adding every exceptions, line by line having to tell the query everytime in which tbl it has to look in... it's a pain!
Then I just need to figure out if version 11.0.5614 is SP2 and 11.0.8173 is SP3 for Office 2003 hehe. Google is my friend on that one!
Thank you!Code:
Select Top 1000000 tblSoftware.softwareName As Software, Count(Distinct
tblComputers.Computername) As number, tblComputers.Username,
tblComputers.Userdomain, tblComputers.ComputerUnique
From tblComputers Left Join
tblSoftware On tblComputers.Computername = tblSoftware.ComputerName Inner Join
tblADusers On tblADusers.Userdomain = tblComputers.Userdomain
Where tblSoftware.softwareName Like 'Microsoft Office%' And
tblSoftware.softwareName Not Like '%2007%' And tblSoftware.softwareName Not
Like '%2010%' And tblSoftware.softwareName Not Like '%Kit%' And
tblSoftware.softwareName Not Like '%Viewer%' And
tblSoftware.softwareName Not Like '%Web%' And tblSoftware.softwareName Not
Like '%Add-in%' And tblSoftware.softwareName Not Like '%Outlook%'
Group By tblSoftware.softwareName, tblComputers.Username,
tblComputers.Userdomain, tblComputers.ComputerUnique
Order By tblSoftware.softwareName