Hi Hawg,
I don't have any code for this, but I offer the following algorythm for consideration.
1). Establish a two dimensional array where
the first subscript represents the year and,
the second subscript represents the month.
2). Size the array for the number of years that you need to process, beginner with the earliest year in the history file, and continuing to an appropriate point in the future.
Lets say your history start in 1980, and you want to go thru the year 2010.
Then the first dimension would be (LastYear - FirstYear) + 1
To determine the first subscript, subtract the base year from the history record year.
Feb81 would be 1981 - 1980 which is 1
Aug98 would be 1998 - 1980 which is 18
Dec10 woube be 2010 - 1980 which is 30
It appears that you have only 2 digit years,
but it should not be difficult to "window" the year to determine the century.
The second dimension is 0 to 11 for the months.
Because of the way the months are named, you'll need to convert them
Select Case UCase(Left(HistDate, 3))
Case "JAN"
month_id = 0
case "FEB
month_id = 1
...
End Select
Read the history table and order by employee number,
and for each employee, initialize the array to all False, and then build the array.
In building the array, you'll need to convert the year and month to the appropriate subscripts.
When you're done with the first employee, then check for 3 consecutives something like this
for year = 0 to lastyear
for month = 0 to 11
select case month
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
if ((array(year, month) = True) and _
(array(year, month+1) = true) and _
(array(year, month+2) = true)) then
<we have a match>
case 11
if (year < lastyear) then
if array(year, 11) = True and _
array(year, 12) = true and _
array(year+1, 0) = true) then
<we have a match>
end if
endif
case 12
if (year < lastyear) then
if array(year, 12) = True and _
array(year+1, 0) = true and _
array(year+1, 1) = true) then
<we have a match>
end if
endif
end select
next month
next year
The reinitialize the array to false, and do the next employee.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein