Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help sorting a recordset

Status
Not open for further replies.
Mar 4, 2001
43
US
I have a recordset that imports several fields from a table including a date/time value based on when the record was entered. The query that does this includes an ORDER BY clause for the date/time. What I want to do is then loop through the recordset and look for the time gaps between the record entries. Technically it's working (it runs without error and gives me values) but when I dump the actual calculations out to a file I don't think it's actually going lowest date/time value to next lowest date/time value. I think I'm missing some records and the ones I do have don't always go in consecutive order. How can I ensure that I fetch records lowest value to next lowest value, based a a field?
 
dear therayster,

are you sure that the field you are ordering by is really a DATE Type?

Otherwise it could be ordered alphanumerically is it was a STRING .

regards Astrid
 
The records are being pulled from a table linked to an Oracle 8i db. I've confirmed it's coming across as a date/time.
 
It sounds to me like your ORDER BY clause isn't working. There could be a problem in linking to the Oracle table so that you just think you're getting the records ordered as you want, but they're actually in some other order. Why don't you try importing the data into a temporary table so you can verify that the records are ordered properly? Then you can base a recordset on the temporary table and see if that works. Once you know how the data is supposed to appear you can go back to basing your recordset on the query to see where the problem is.

Uncle Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top