N
nando
Guest
I have a table(Prices) with the following fields:-
PriceDate
FundName
BidPrice
OfferPrice
ExchRate
I am trying to select the most recent Price record for each FundName.
So far I have the following:-
SELECT * FROM Prices
WHERE PriceDate = (SELECT Max(PriceDate) FROM Prices)
but this selects only the funds with the most recent date, i.e. if Fund A's most recent date is 01 Oct 2001 but Fund B, C, etc is 05 Oct 2001 then a record for Fund A is not selected.
I have tried adding the following GROUP BY in the Subselect
SELECT * FROM Prices
WHERE PriceDate = (SELECT Max(PriceDate) FROM Prices GROUP BY FundName)
but this won't run at all.
Any ideas?
PriceDate
FundName
BidPrice
OfferPrice
ExchRate
I am trying to select the most recent Price record for each FundName.
So far I have the following:-
SELECT * FROM Prices
WHERE PriceDate = (SELECT Max(PriceDate) FROM Prices)
but this selects only the funds with the most recent date, i.e. if Fund A's most recent date is 01 Oct 2001 but Fund B, C, etc is 05 Oct 2001 then a record for Fund A is not selected.
I have tried adding the following GROUP BY in the Subselect
SELECT * FROM Prices
WHERE PriceDate = (SELECT Max(PriceDate) FROM Prices GROUP BY FundName)
but this won't run at all.
Any ideas?