Page 1 of 1

Selecting max Date Record

Posted: Fri Apr 21, 2006 10:33 am
by iwin
Hi,
I have two records source with same keys but the only difference is the Date field. And i need to pick the record which has a max date and ignore the other record.

Please advice me.

Thanks In Advance

Posted: Fri Apr 21, 2006 10:48 am
by ArndW
What datatype and format is your date column? If it is a string in the form of yyyy-mm-dd then a simple string comparison will suffice.

Re: Selecting max Date Record

Posted: Fri Apr 21, 2006 10:50 am
by rwierdsm
Assuming that the source is a flat file, run the data through an aggregator, grouping by all the fields except the date field then select the max date. Only one row will survive the aggregation.

If the source is an RDBMS, you could do something similar using a group by in the SQL.

HTH,

Rob W

Posted: Fri Apr 21, 2006 1:18 pm
by iwin
Hi,
It worked by giving group by in SQL.

Thanks Guys