You need to post more info about your data. I assume that there isn't a field that can be used in a record selection formula to test for active records? Also, are you implying that if a record isn't the most recent record then it is inactive? If so, then you need to reference this post which gives you the SQL for printing the most recent records (I also discuss this in my Best Of The Forum sections in my new book).
Most Recent Record