When I run the following code, instead of reading values from the last record, the variables are being assigned field values from a much earlier record (records are sorted by date). It seems to randomly select the record to read from! This used to work correctly. I have verified that...