arrMonths=getmonths(rsRecords.getrows(adGetRowsRest))
function getmonths(arr)
dim arrTemp,intDiff,strDate,strTemp
arrTemp=array()
for x=0 to ubound(arr,2)
strTemp=arr(0,x)
if not inarray(arrTemp,strTemp) then
redim preserve arrTemp(ubound(arrTemp)+1)
arrTemp(ubound(arrTemp))=strTemp
end if
intDiff=arr(1,x)
if intDiff<0 then intDiff=12+intDiff
if intDiff>0 then
strDate=stringtodate(strTemp&"01","",false,"",false)
for y=1 to intDiff
strTemp=datetostring(dateadd("m",y,strDate),false)
if not inarray(arrTemp,strTemp) then
redim preserve arrTemp(ubound(arrTemp)+1)
arrTemp(ubound(arrTemp))=strTemp
end if
next
end if
next
for x=0 to ubound(arrTemp)
for y=x+1 to ubound(arrTemp)
if arrTemp(x)<arrTemp(y) then
strTemp=arrTemp(x)
arrTemp(x)=arrTemp(y)
arrTemp(y)=strTemp
end if
next
next
getmonths=arrTemp
end function
Works a treat and returns an array of months exactly as I need them