Solved

exclusive and

Posted on 2014-02-14
4
133 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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…
Viewers will learn how the fundamental information of how to create a table.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now