Does this return the logs in order by date?  If so, could you add a counter to these, so that I can avoid calculating which day is the earliest?