Solved

Assistance finding members with no claims

Posted on 2013-05-15
4
219 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
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 300 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 200 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
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
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

770 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