I have been trying without successful and wondered if the Tek-Tips forum could help me put a query together in Access.
There are two tables I would like to use - TRANSACTIONS and VALUATIONS
TRANSACTIONS has Fund,TradeDate,ParValue
VALUATIONS has Fund, ValueDate, Price
I would like to create a query that outputs every day (ValueDate) between a specified range, even if the date does not exist in the VALUATIONS table. If it doesn't exist, it would bring the previous existing Price from VALUATIONS in the list.
The code I have can only generate a holdings if the VALUATIONS table has a ValueDate.
Could somebody suggest whether I could do this?
There are two tables I would like to use - TRANSACTIONS and VALUATIONS
TRANSACTIONS has Fund,TradeDate,ParValue
VALUATIONS has Fund, ValueDate, Price
I would like to create a query that outputs every day (ValueDate) between a specified range, even if the date does not exist in the VALUATIONS table. If it doesn't exist, it would bring the previous existing Price from VALUATIONS in the list.
The code I have can only generate a holdings if the VALUATIONS table has a ValueDate.
Code:
SELECT VALUATIONS.ValueDate, VALUATIONS.Fund, Sum(IIf([ValueDate]>=[TradeDate],[ParValue],0)) AS Holdingss, VALUATIONS.Price
FROM TRANSACTIONS, VALUATIONS
GROUP BY VALUATIONS.ValueDate, VALUATIONS.Fund, VALUATIONS.Price
HAVING (((VALUATIONS.ValueDate)>[Specify Start Date] And (VALUATIONS.ValueDate)<[Specify End Date]));
Could somebody suggest whether I could do this?