SerenityNet
Registered User.
- Local time
- Yesterday, 20:42
- Joined
- May 6, 2003
- Messages
- 27
I have a table with say two fields, Item and EffectiveDate. I will have data as follows.
Item EffectiveDate (mm/dd/yy)
One 04/01/2003 (record 1)
One 04/04/2003 (record 2)
One 04/06/2003 (record 3)
One 04/03/2003 (record 4)
Two 04/05/2003 (record 5)
Two 04/04/2003 (record 6)
I only want to return the records with the most recent (greatest) effective date that is less-than or equal-to today, for each item. If "today" were 04/05/03 (mm/dd/yy), in the above example, I would want to return record 2 for item One and record 5 for item Two. I won't have duplicate effective dates for the same item. How do I do this?
Thanks in advance,
Andrew
Item EffectiveDate (mm/dd/yy)
One 04/01/2003 (record 1)
One 04/04/2003 (record 2)
One 04/06/2003 (record 3)
One 04/03/2003 (record 4)
Two 04/05/2003 (record 5)
Two 04/04/2003 (record 6)
I only want to return the records with the most recent (greatest) effective date that is less-than or equal-to today, for each item. If "today" were 04/05/03 (mm/dd/yy), in the above example, I would want to return record 2 for item One and record 5 for item Two. I won't have duplicate effective dates for the same item. How do I do this?
Thanks in advance,
Andrew