i have a table where i need to select the Status from the MAX(DateAdded) for each month for each loan.
Table [AdditionalStatus] Structure
LoanID
DateAdded
Status
EXAMPLE
001 2/15/06 ABC
001 2/17/06 GHI
002 2/18/06 ABC
in the above example the first one would not be selected because the max date for loan 001 is on 2/17/06. I hope this is clear enough.
My current SQL statement.
Select * from AdditionalStatus order by LoanID, DateAdded
Table [AdditionalStatus] Structure
LoanID
DateAdded
Status
EXAMPLE
001 2/15/06 ABC
001 2/17/06 GHI
002 2/18/06 ABC
in the above example the first one would not be selected because the max date for loan 001 is on 2/17/06. I hope this is clear enough.
My current SQL statement.
Select * from AdditionalStatus order by LoanID, DateAdded