?
Solved

exclusive and

Posted on 2014-02-14
4
Medium Priority
?
148 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 66

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 66

Accepted Solution

by:
Jim Horn earned 2000 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 66

Expert Comment

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

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.
Suggested Courses

765 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