we are talking about contracts, everymonth we take a "position" or mark the
value of those contracts. Almost everymonth, i add new contracts & on fewer
Months I close them which means i no longer track them. So i need to be able
to add and remove contracts and add positions. Which is why i say that i need
a table that can expand in both numbers of rows and columns. or back to my
original question, i need a way to relate the primary key in one table with
the columns in another table. And it needs to be easy to maintain because i
will not be maintaining it.
So... Each Contract has zero, one or more Positions, and each position has a
date as an attribute.
You can do this with two permanent, unchanging tables:
Contracts
ContractNo <Primary Key>
InitialDate <Date/Time>
TerminatedDate <date/time, NULL for currently active contracts>
<descriptive information about the contract as an entity>
Positions
PositionID <Primary Key>
ContractNo <link to Contracts>
PositionDate <date/time>
Valuation <currency, value of this contract as of this date>
<any other information pertaining to this position>
A Query selecting contracts with a non-NULL TerminatedDate will show active
contracts (a date criterion will let you retain a historical record of past
contracts).
Each Contract can be linked to any desired number of positions; you can add a
position at any point in time, search for it, etc.
"Fields are expensive. Records are cheap". It is NOT necessary - in fact it's
not a good idea and not good design! - to add a new column every time you have
a new position, or a new contract.
You're using a relational database - use it relationally!