G
Guest
I have a table with three columns: Type, Year, Rate. A new record is added
for a given type only when the rate is updated. How can I select, for each
type, the rate that is in effect for a specified year? I.E. For each type,
retrieve the most recent record that is less than or equal to a specified
year, which is retrieved from another table.
Example:
Rec# Type Year Rate
1 1 2004 20
2 1 2006 30
3 2 2004 30
4 2 2005 25
5 2 2007 40
Specified Year Records Returned
2004 1, 3
2005 1, 4
2006 2, 4
2007 2, 5
Any suggestions would be greatly appreciated.
....Larry
for a given type only when the rate is updated. How can I select, for each
type, the rate that is in effect for a specified year? I.E. For each type,
retrieve the most recent record that is less than or equal to a specified
year, which is retrieved from another table.
Example:
Rec# Type Year Rate
1 1 2004 20
2 1 2006 30
3 2 2004 30
4 2 2005 25
5 2 2007 40
Specified Year Records Returned
2004 1, 3
2005 1, 4
2006 2, 4
2007 2, 5
Any suggestions would be greatly appreciated.
....Larry