Getting information from another record in the same DB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new so please forgive if this is really easy.

I have a database in the following format:
Line 1 has basic information about a stock (Name, Symbol, etc.)
Lines 2 thru ? have prices (Open, High, Low, Close, etc.) for a month worth
of days with each day on a separate line.

The next line has basic information about another stock
Lines that follow have prices for a month worth of days for this new stock

This continues for a bunch of stocks going back to 1984

I'd like to add the basic information to each record but don't know how to
do it.

The result would be each line with roughly the following format:

Open, High , Low, Close, Stock Name, Stock Symbol

Sorry, if this was in Excel I'd be a champ but there's too much info for Excel
 
From what I can gather from your post...
I think you've designed a "flat" datbase, where every day you want to
re-enter the Line1 info, and it's associated Line2 info.
Like this I think...
Stock Price
IBM 70.20
IBM 71.00
IBM 70.60 etc....

You really need 2 tables to properly set this system up as a "one to
many" realtionship, and fully utilize the power of a relational database...
Each Stock represents the One. Create a table (ex tblStocks) and use a
key field (ex an Autonumber field) to identify each stock uniquely (ex.
StockID) This would contain StockName, DatePurchased, Qty, etc...
Create another table called tblPrices (the Many) that would contain all
the daily price information (High, Low, etc... and also a StockID field
(numeric/long))
Create a relationship between tblStocks and tblPrices via the common
StockID field.

Here's what you're trying to do... Create a form where the main form is
based on the "One" tblStocks. On that form, place a continuous subform
based on the "Many" tblPrices, and linked to the Main form via StockID.
Now, you can enter the Stock information in the main, and can then enter
an unlimited amount of daily Price info. All the Price info will be
automatically associated with the appropriate Stock because of the StockID
relationship between the 2 tables. Your table data would now look like
this...
tblStocks (One) tblPrices (Many)
Name StockID StockID Price
IBM 17 17 70.20
17 71.00
17 70.60
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top