G
Guest
I’m using a db to track investments. Simplified, there are two tables with a
one to many relationship
Fields included in the first table, tblPrime are:
InvID (primary key)
PurchAmt
FinInst
Security
The second table, tblDetail has following fields:
DateEntry
InvID
InterestAmt
Autonum (primary key)
There will be multiple transactions recorded in the tblDetail that match up
to one record in the tblPrime table by the InvID fields. As interest is
received it will be recorded by DateEntry in the tblDetail.The total worth of
the investment will equal a sum of all the InterestAmt fields added to the
PurchAmt.
I’ve generated a query that will give me the value of all the investments as
of today’s date by first creating a query that sums the InterestAmount
grouped by InvID and then using that query in another with the tblPrime table
joined by InvID. The problem I’m having is that I want to be able to run a
query that will generate a report totaling the worth of the investments on
prior dates. I have a date field to run it against in the tblDetail, but I
can’t figure out then how to sum the InterestAmt results as of that prior
date and join them to InvID in tblPrime. Any help is appreciated.
one to many relationship
Fields included in the first table, tblPrime are:
InvID (primary key)
PurchAmt
FinInst
Security
The second table, tblDetail has following fields:
DateEntry
InvID
InterestAmt
Autonum (primary key)
There will be multiple transactions recorded in the tblDetail that match up
to one record in the tblPrime table by the InvID fields. As interest is
received it will be recorded by DateEntry in the tblDetail.The total worth of
the investment will equal a sum of all the InterestAmt fields added to the
PurchAmt.
I’ve generated a query that will give me the value of all the investments as
of today’s date by first creating a query that sums the InterestAmount
grouped by InvID and then using that query in another with the tblPrime table
joined by InvID. The problem I’m having is that I want to be able to run a
query that will generate a report totaling the worth of the investments on
prior dates. I have a date field to run it against in the tblDetail, but I
can’t figure out then how to sum the InterestAmt results as of that prior
date and join them to InvID in tblPrime. Any help is appreciated.