Solved

exclusive and

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

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…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

867 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