Hello,
I'm trying to query a table to return records with the latest contract date. I've tried a bunch of max date codes that I found on the forum but none of them seem to return what I'm looking for. Here's my table:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Group[/TD]
[TD]Level[/TD]
[TD]ContractDate[/TD]
[TD]Salary[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2001[/TD]
[TD]10000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2002[/TD]
[TD]11000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2001[/TD]
[TD]20000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2002[/TD]
[TD]21000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2001[/TD]
[TD]10000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2002[/TD]
[TD]11000[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to get the following results:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Group[/TD]
[TD]Level[/TD]
[TD]ContractDate[/TD]
[TD]Salary[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2002[/TD]
[TD]11000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2002[/TD]
[TD]21000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2002[/TD]
[TD]11000[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to query a table to return records with the latest contract date. I've tried a bunch of max date codes that I found on the forum but none of them seem to return what I'm looking for. Here's my table:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Group[/TD]
[TD]Level[/TD]
[TD]ContractDate[/TD]
[TD]Salary[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2001[/TD]
[TD]10000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2002[/TD]
[TD]11000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2001[/TD]
[TD]20000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2002[/TD]
[TD]21000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2001[/TD]
[TD]10000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2002[/TD]
[TD]11000[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to get the following results:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Group[/TD]
[TD]Level[/TD]
[TD]ContractDate[/TD]
[TD]Salary[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]01/04/2002[/TD]
[TD]11000[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]01/04/2002[/TD]
[TD]21000[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[TD]01/06/2002[/TD]
[TD]11000[/TD]
[/TR]
</tbody>[/TABLE]