S
Steve via AccessMonster.com
I have query that shows all contracts, and links to the vendor table to
include the vendor name - we only have one "active" contract at a time per
vendor, which would be the one with the latest expiration date - so I want to
filter out old contracts - just show the ones with the latest expiration date
BY VENDOR NAME
Here is my SQL as is, but it shows all contracts - I just want to show one
contract per vendor
================================================================
SELECT CONTRACTS.ContractNum AS ContractNumber, T.Value, T.Type, T.StartDate
FROM CONTRACTS AS T INNER JOIN [Select ContractNum,Max(EndDate) as MxDate
FROM CONTRACTS GROUP BY ContractNum]. AS Mx ON (T.EndDate = Mx.MxDate) AND (T.
ContractNum = Mx.ContractNum);
================================================================
Any help would be greatly appreciated,
Steve
include the vendor name - we only have one "active" contract at a time per
vendor, which would be the one with the latest expiration date - so I want to
filter out old contracts - just show the ones with the latest expiration date
BY VENDOR NAME
Here is my SQL as is, but it shows all contracts - I just want to show one
contract per vendor
================================================================
SELECT CONTRACTS.ContractNum AS ContractNumber, T.Value, T.Type, T.StartDate
FROM CONTRACTS AS T INNER JOIN [Select ContractNum,Max(EndDate) as MxDate
FROM CONTRACTS GROUP BY ContractNum]. AS Mx ON (T.EndDate = Mx.MxDate) AND (T.
ContractNum = Mx.ContractNum);
================================================================
Any help would be greatly appreciated,
Steve