Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New To access.. Importing and using question

Status
Not open for further replies.

laythss

Technical User
Oct 27, 2004
10
US
Hello all, I am all new to access and I am trying to convert a program I made from excel VBA to ASP.net using access data bases. I am not even sure if this is possible, but I started looking into access couple of days ago, and reading examples of using it for websites etc. that I think it might have the potential.
My question is:
I have an excel file that has the following format:
months 1 2 3 4 5 6 7 8 9 10 11 12
Products

product1 20 5 9 8 etc
product2 9 6 7 3
product3 8 4 2 1
product4 100 26 78 32
.
.
.

Now the way I pull data out of this sheet of excel is if a user asks for the total number of products sold in february, the program will search for the month (2 in this case and that would be the fixed column) then it will add up all the entries in that column after row 1 (row one is the row that has the month numbers) and display the total (for this example it would be 41).

This is a real simplification of what is done but I think is brings out my question of how to build a data base for such data where I would need to make a 2 dimensional search, since from what I could not figure out how to incorperate my months into the data base in access when I tried to convert the file from excel to a database table in access.

I hope someone could help me. and I thank you all for you comments and replies in advance.
Edit/Delete Message
 
thanks PVH that was a great article, but now I have a more specific question.
Can a Foreign Key point to ONE of the Combined Keys in a another table??

I have a table (Clien_info) as follows:
ID(Auto)[PK] Client_Name Billing_zip Contact_last_name Machine_number[FK]
1 aaCorp 93101 Smith 200
2 aaCorp 93101 Smith 210
3 bbCorp 94070 Young 201
4
..
I have a table (MachineList) as follows:
Machine_Number[PK] Product_List_number [FK]
201 1
210 2
200 1
and I have another table (ProductListDetail) as follows:
Product_List_number Product_name
1 black coffee
1 latte
1 chocolate
2 hazelnut coffee
2 black coffee

this primary key for this last table can be a combo of the two columns

so can I point Product_List_Number in the MachineList table to Product_List_number in ProductListDetail table.

what I am trying to do:
each client would have one or more machines installed at their location, these machines have a variety of option of products that can be included, in the example I gave above aaCorp has two machines installed (200 and 210) the machine 200 will dispense black coffee, latte, and chocolate, yet the other machine (210) will only dispense Hazelnut Coffee and black coffee.

Is there a better way of doing it while keeping my tables in a third normal form?
"A table is said to be in Third Normal Form (3NF), if it is in 2NF and if all non-key columns are mutually independent.?
 
Have a look at how to handle a many-to-many relationship.
It is often named a junction (or bridge or relations) table.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top