I'm at a point beyond my coding abilities.
I have a table with thousands of members and their effective and end enrollment dates. I need to find which where continuously enrolled with less than 30 day gap between last end date and new enroll day and then for those not continously enrolled I need the latest membership span.
Someone mentioned using cursors but I have not idea what they are talking about.
Example
Pt not continuously enrolled (need last continuous date span)
Pt Nbr Eff Date end date
49700 20061201 20090930 --
49700 20091201 20091231
49700 20100101 20100531
pt continuously enrolled ( no gap in enrollment)
Pt Nbr Eff Date end date
49702 20071201 20071231
49702 20080101
Any help would be appreciated.:crazy: