It is important that you have an ORDER-clause in your SELECT statement so you get the dates in ascending order. You can rely on the table being in sorted order by date without specifying it.
Your SQL should then look like this:
SQL SELECT CustomerID,
ORDER BY OrderDate
Then the Peek()-functions can deliver the minimum and maximum value guaranteed. Without ORDER you run the risk of getting a newer date as minimum and an older date as maximum and you run into the trouble you show us...