Lansweeper logo
Home Download Features Demo Buy now Help Support forum
 
    Most requested support articles:
  Lansweeper troubleshooting guide.
  The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
  WMI Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  How to configure the windows firewall using group policies.
  Support:  
 support@lansweeper.com  
Skype: Lansweeper  
  Mo-Fri 9h-17h CET  
Welcome Guest Search | Active Topics | Log In | Register

Untag as favorite
Like, And, Or, Not Like for a unique Where search, that's possible?
soucyinter
#1 Posted : Friday, November 18, 2011 4:38:49 PM

Rank: Premium user

Groups: Premium Users, Member
Posts: 15
Location: Drummondville, QC
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...Think

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
soucyinter
#2 Posted : Friday, November 18, 2011 4:54:28 PM

Rank: Premium user

Groups: Premium Users, Member
Posts: 15
Location: Drummondville, QC
Here's what I thought would work... but it doesn't! Not talking

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%', '%2010%', '%Kit%', '%Viewer%', '%Web%', '%Add-in%', '%Outlook%')
Group By tblSoftware.softwareName, tblComputers.Username,
  tblComputers.Userdomain, tblComputers.ComputerUnique
Order By tblSoftware.softwareName
Users browsing this topic
Guest
Untag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Contact: E-mail Lansweeper - Skype : Lansweeper
Copyright 2004 - 2011 © Hemoco bvba