There is no need to loop here - you could simply perform a find for records within the range.
However, for learning purposes only, your script should roughly:
1. Load the start and end dates into variables (unless they are entered into global fields, and thus accesible from any table);
2. Go to a layout of the data table;
3. Show all records;
4. Go to the first record;
5. Loop: If date is within the range, omit the record, else go to next record (exit after last).