Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Choosing most recent month plus multiple fields

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-21 : 20:24:19
kelly writes "i have a table which lists investment funds and is set up like this:
aut_fundID
txt_fundName
txt_series
int_month
int_year
int_NAV

and some more fields but these are enough for now. there are about 60 funds in this table with various months and years. i need to pick the most recent month for this year that exists for a fund. i tried MAX but when i add into the GROUP BY a bunch of other fields (aut_fundID for example), it returns all the funds, not the max month of this year. so i can get it to work if i just return the fund name.

it is too late at this point to redesign the table structure, it could be better.

thanks"
   

- Advertisement -