Hi Stockman,
All of the attributes you listed are appropriate for storing in a
StockTransactions table. If you don't need any additional data stored, then
it looks like one table should work. On the other hand, if you want to store
the name of the company, the stock exchange, etc., then you would not want to
repeat all of this data in the StockTransactions table. For example, lets say
you wanted to store:
BA The Boeing Company NYSE
In this case, I would recommend two tables:
tblCompanies
pkSymbol (Text (3), primary key)
CompanyName (Text)
Exchange (Text)
tblStockTransactions
pkTransID (Autonumber primary key)
fkSymbol (Text (3), foreign key)
High
Low
Close
Volume
Date
Close Bid
Close Ask
You would then create a one-to-many (1:M) relationship between tblCompanies
and tblStockTransactions. You could even break the Exchange info. out to a
separate table, but that would only be advantageous if you wanted to store
other attributes concerning the Exchange. If the Exchange data was limited to
the abbreviations, such as NYSE, AMEX or NASDAQ, etc. then it is likely not
worth the effort to create such a third table.
To set up a parameter query, you could use the following SQL statement:
SELECT * FROM tblStockTranactions WHERE fkSymbol=[Enter Symbol];
To enter this SQL statement, create a new query after creating your
tblStockTransactions table and adding some test data. In query design view,
click on View > SQL View. Copy the above SQL statement and paste it into the
SQL window. Try running the query.
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
:
Im designing a stock db in ms access and Im not sure on table relationships.
It looks like Im going to have one very large table with these columns:
Symbol, High, Low , Close, Volume, Date, Close Bid and Close Ask. Isnt there
a way to have a few tables tied together instead of one very large table? My
next question would be how to set up a parameter query ie, [Enter Symbol] to
retrieve all records for a stock symbol entered. All options I'll consider
and a speedy answer sure would be appreciated! Thanks.