I have the following info in a table:
[tt]
|---------| Year | Rate |
| Plant A | 2005 | 5.00 |
| Plant A | 2006 | 4.00 |
| Plant B | 2005 | 3.50 |
[/tt]
Not every plant has its rate information changed every year.
What query can I use to ensure I always get the most current info for a plant?
I tried using a select query, setting the WHERE to MAX(Year) but that only returns the rate for records showing 2006--the highest year in the table.
I want the output to show
[tt]
Plant A 2006 4.00
Plant B 2005 3.50
[/tt]
Thanks.
PS If there is a better way to store this info, please let me know that as well.
[tt]
|---------| Year | Rate |
| Plant A | 2005 | 5.00 |
| Plant A | 2006 | 4.00 |
| Plant B | 2005 | 3.50 |
[/tt]
Not every plant has its rate information changed every year.
What query can I use to ensure I always get the most current info for a plant?
I tried using a select query, setting the WHERE to MAX(Year) but that only returns the rate for records showing 2006--the highest year in the table.
I want the output to show
[tt]
Plant A 2006 4.00
Plant B 2005 3.50
[/tt]
Thanks.
PS If there is a better way to store this info, please let me know that as well.