Skip to Content
Former Member
Aug 29, 2007 at 09:09 PM

Latest date


I have the following requirement. Create a custom table that will contain among other things the date and time created. Then every time a certain program runs, it will need to find the table entry with the latest created date. The date is not part of the table key. The table could be quite large.

I'm wondering if anyone has had a similary requirement and how they went about it.

I see a three possible solutions two of which have problems:

1) Read the date into an internal table, sort it and find the latest date/time.

Problem, the table could be quite large therefore possibly running into memory problems (thrashing perhaps) and the time it would take to sort the internal table.

2) Select statement with "order by"

Problem, similar to 1) above, table would be read sequentually, which could be a performance problem.

3) Index the table with date/time

Your feedback will be much appreciated.