Discussion Locked

logic problem

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

while going through a resultset, I get a bunch of records with many fields including date objects. I would like to display only the record with the latest date ? I'm really having trouble coding this.
Thank you

5 replies

by wls

If this was SQLish in nature, I'd say use the MAX() function across a GROUP BY clause.

If this was programatic in nature, I'd say store the date and a reference to the object; enumerate over the objects, and if the date is greater than the storedone, change the date/reference pair. When you've exhausted the list, you've got the one you're interested in.

by vcsekhar007

Just try either max function or try to retieve the data in comparison with sysdate ( current date for oracle )

Lemme know ur comments on this...

This discussion is closed to new replies.