Solved

Assistance finding members with no claims

Posted on 2013-05-15
4
185 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

757 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

22 Experts available now in Live!

Get 1:1 Help Now