Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assistance finding members with no claims

Posted on 2013-05-15
4
Medium Priority
?
276 Views
Last Modified: 2013-05-15
Hi Experts,

My thanks in advance for your assistance...

Code-wise, I am having a hard time with my SQL trying to figure out who has never had a claim for a certain time period yet is a member during the same time period.

It is easy for those with any claims between start_dt and end_dt but to state having a count of zero or NULL claims I realize is not logical.

The basic tables I am working with are MEMBERS and MASTER_CLAIM and maybe need to pull in a membership view vmembership.

I can provide some basic column names and data -- at this point I need more help jump-starting how to tackle the process!
0
Comment
Question by:britpopfan74
[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
4 Comments
 
LVL 7

Expert Comment

by:Ross Turner
ID: 39168424
I can provide some basic column names and data -- at this point I need more help jump-starting how to tackle the process!

This will help to get our teeth stuck into your problem.....
0
 
LVL 6

Accepted Solution

by:
BurundiLapp earned 1200 total points
ID: 39168428
You could select all the members where membership was valid during the given period and perhaps use a not in statement to exclude them from the list of members that have had a claim in that period

e.g:
Select memberID, memberName, etc
from members
where membership_start_dt >= '20120101' and membership_end_dt < '20130101'
and memberID NOT IN (Select memberID from MasterClaim where where start_dt >= '20120101' and end_dt < '20130101')
0
 
LVL 25

Assisted Solution

by:Lee Savidge
Lee Savidge earned 800 total points
ID: 39168485
Just create a SQL statement that returns the member ID's where membership was valid and then put an surrounding select where you return all records where the member ID is not in the inner select statement.
0
 

Author Closing Comment

by:britpopfan74
ID: 39168602
Thank you very much for your help!
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

688 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