Solved

exclusive and

Posted on 2014-02-14
4
139 Views
Last Modified: 2014-02-14
Hello expert,

Need to search for cases in cases database. Need to group
all the cases Description that are concerned with DataVault
and then separate them by Incident or Service Request.
The query written is copied herewith below.

The problem is it is not differentiating between Incident
and Service Request cases. I tried adding to the Where clause
([Case type] not LIKE 'Incident')
But the Incident cases are still showing up.

Way of a good way of doing this?

Thanks

Allen in Dallas

++++++++++++++begin of query+++++++++++++++++++
SELECT        ['Raw data$'].*, [Case Type] AS Case_type
FROM            ['Raw data$']
WHERE        ([Description] LIKE 'DataVault backup monitor%')
or
([Description] LIKE 'Datavault Data: BackupStatus.xml%')
or
([Description] LIKE 'Datavault __: BackupStatus.xml%')
or
([Description] LIKE 'Datavault SystemState%')
and
([Case type] LIKE 'Service Request')
and
([Case type] not LIKE 'Incident')

+++++++++++++++end of query+++++++++++++++++
0
Comment
Question by:9apit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39859355
>I tried adding to the Where clause   ([Case type] not LIKE 'Incident')
You need to add a percent sign ( % ) to uses as a wildcard, either to the left or the right or both..

WHERE [Case type] NOT LIKE '%Incident%'
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39859358
WHERE this OR that OR those OR these AND that_too AND this_too

btw you may want to consider adding parentheses ( ) to establish order of precedence, if any of these need to be grouped together when doing the AND OR logic, such as..

WHERE (this OR that OR those OR these) AND that_too AND this too
0
 

Author Closing Comment

by:9apit
ID: 39859498
The parenthesis grouping worked. Thanks.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39859522
Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question