M
Michael Conroy
I have a table listing 3,000 legal entity IDs each with multiple contracts
and each contract has a different execution date. The only valid contract is
the most recent one. I need a way to find the maximum date for each entity
and flag it for later use. My thinking was to add a boolean column called
"Valid" and running an update query. The problem is I don't know how to get
the maximum date for each entity. I am worried the max date will be the
maximum value for the entire table rather than the maximum for that entity.
Anyway, the first two columns below represent what I have and the valid
column is what I need. As always, any help would be greatly appreciated.
LEID Execution Valid
001 2/2/2002 False
001 3/3/2003 True
002 4/4/2004 True
003 5/5/2005 False
003 6/6/2006 True
and each contract has a different execution date. The only valid contract is
the most recent one. I need a way to find the maximum date for each entity
and flag it for later use. My thinking was to add a boolean column called
"Valid" and running an update query. The problem is I don't know how to get
the maximum date for each entity. I am worried the max date will be the
maximum value for the entire table rather than the maximum for that entity.
Anyway, the first two columns below represent what I have and the valid
column is what I need. As always, any help would be greatly appreciated.
LEID Execution Valid
001 2/2/2002 False
001 3/3/2003 True
002 4/4/2004 True
003 5/5/2005 False
003 6/6/2006 True