Hmm, nothing stands out as wrong in the logic to me. Could `store_num` or `lane_num` have changed between runs? Is it a shared db, i.e. is it possible someone else is accessing the database (adding/removing records) while you're testing?
You have some other inconsistencies in the output above. For example: 1) you define `itemEntry` yet query `transEntry` in your examples; 2) your record count shows 5213, yet later you said you expect 523 records; 3) you reference variable `gar` at the end, presumably meant to be `first_search` ) I'd suggest starting a new session and running your code again from scratch. That usually helps resolve issues for me after a late night of coding tunnel vision ;)