>SELECT LineTemp >SET RELATION TO BoIdBase INTO Details > >** Loop once for each line item record >SCAN > > ** Clear the number cleared counter > m.NumCleared = 0 > > ** Loop once for each detail record belonging to the > ** current line item > SELECT Details > DO WHILE BoIdBase = LineTemp.BoIdBase > > ** If the record is active, and has an air time and falls in the > ** date range, then count it > IF Details.RecType = "A" AND; > NOT EMPTY(AirTime) AND ; > BETWEEN(AirDate, dStartDate ,dEndDate) > > ** Increment the number cleared variable > m.NumCleared = m.NumCleared + 1 > > ENDIF > > IF EOF() > EXIT > ELSE > SKIP 1 > ENDIF > > ENDDO > > SELECT LineTemp > GATHER MEMVAR > >ENDSCAN >