I am trying to build a filter to show all active updates for every program in the office 2013 suite. I have rtied a few things and this is my surrent code. But even with the excusions in the title feild it keeps including updates for all office versions.

select UID from KBSYS.PATCHLINK_PATCH where ((((((((((((((((  
KBSYS.PATCHLINK_PATCH.VENDOR like '%Microsoft%') AND
KBSYS.PATCHLINK_PATCH.TITLE like '%2013%') AND
KBSYS.PATCHLINK_PATCH.TITLE not like '%2003%') AND
KBSYS.PATCHLINK_PATCH.TITLE not like '%2010%') AND
KBSYS.PATCHLINK_PATCH.TITLE not like '%2007%') AND
(1  in (select 1 from PATCHLINK_PATCH_STATUS where PATCHLINK_PATCH.UID = PATCHLINK_PATCH_STATUS.PATCHUID and PATCHLINK_PATCH_STATUS.STATUS = '0')) ) AND
KBSYS.PATCHLINK_PATCH.TITLE like '%Office%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Lync%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%OneNote%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Outlook%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Word%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%PowerPoint%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Junk E-mail%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Visio%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%ShrePoint%') OR
KBSYS.PATCHLINK_PATCH.TITLE like '%Excel%')
Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

Have you thought about breaking it out like this?

select UID

from KBSYS.PATCHLINK_PATCH

where KBSYS.PATCHLINK_PATCH.VENDOR like '%Microsoft%' AND

(KBSYS.PATCHLINK_PATCH.TITLE like '%POWERPOINT 2013%' OR

KBSYS.PATCHLINK_PATCH.TITLE like '%OUTLOOK 2013%' OR

KBSYS.PATCHLINK_PATCH.TITLE like '%WORD 2013%' OR

KBSYS.PATCHLINK_PATCH.TITLE like '%OFFICE 2013%')

AND (1  in (select 1 from PATCHLINK_PATCH_STATUS where PATCHLINK_PATCH.UID = PATCHLINK_PATCH_STATUS.PATCHUID and PATCHLINK_PATCH_STATUS.STATUS = '0'))
 
... or just keep it simple. I think the patches you are seeing when running something like this below are the ones for 2010 that have (released May 2013) in the title. So it's picking those up.
 
select UID
from KBSYS.PATCHLINK_PATCH 
where ((((KBSYS.PATCHLINK_PATCH.VENDOR like '%MICROSOFT%') AND  
(KBSYS.PATCHLINK_PATCH.TITLE like '%2013%') AND
(KBSYS.PATCHLINK_PATCH.TITLE not like '%2007%') 
AND KBSYS.PATCHLINK_PATCH.TITLE not like '%2010%'
AND KBSYS.PATCHLINK_PATCH.TITLE not like '%2003%')))
AND
(1  in (select 1 from PATCHLINK_PATCH_STATUS where PATCHLINK_PATCH.UID = PATCHLINK_PATCH_STATUS.PATCHUID and PATCHLINK_PATCH_STATUS.STATUS = '0'))
 
 
Answered 07/16/2013 by: dugullett
Red Belt

  • Thanks I was able to get it to work with the first block of code you placed.
Please log in to comment
Answer this question or Comment on this question for clarity

Share