member months in medical enrollment
Posted on 2006-04-19
Back with another question. Thanks in advance for any help
For this question I have two table I am concerned with, called membe and member hp
Member looks like
Memberkey int (fk)
Membid varchar (15) (pk)
Lastnm varcahr (50)
Firstnm varchar varchar (50)
Membhp looks like
Memberkey int (pk)
Currhist char (1) -- C for Current, H for history meaning the data is for the current
enrollment or the historical enrolment.
Opfromdt -- Date they were enrolled
Opthrudt -- date they were terminated
The member can have many entries in membhp as they can come on the plan a lot
What I do not know how to do is determine is how many months a member has been on the plan, if there has been a break from their time on the plan.
So say I want to know how many months a member x.
Member x has been on the plan from 04/01/2004 to 03/01/2005 . They came back on the plan on 04/01/2005 and are set to terminate 01/01/2079.
How do I determine how many moths from 01/01/2005 to 12/31/2005 the member has been on the plan for.
If this is not clear ask me to clarify and I will, if I can.
Thanks in advance for any help