Multiply Values in One Field

  • Thread starter Thread starter recardo_msp
  • Start date Start date
R

recardo_msp

Guest
I have a customers table that has a field called order ID(s) in it. There is a table also called orders, in this table there is a field called product ID(s), i need muliply product ID's to go into that field......

also a cust is going to get more than one order ID cause they may order again so the Order ID's field in customers also needs do have multiple orders ID in there.

any ideas??
 
recardo_msp said:
I have a customers table that has a field called order ID(s) in it. There is a table also called orders, in this table there is a field called product ID(s), i need muliply product ID's to go into that field......

also a cust is going to get more than one order ID cause they may order again so the Order ID's field in customers also needs do have multiple orders ID in there.

any ideas??

Customer table should have also OrderDate field in order to keep multiple the same Order ID. This field can be a part of primary key along with OrederID field.
Igor.
 
yeah, in the customers table though the customer ID is an autonumber, so all of the customers orders are in the one row. so all of the order ID's have to be in that one field.

THe primary key in the customers is table is customer ID, so i cant haev order ID and order date in there as primary keys
 
You don't store multiple ID's in one field...

Your approach / design is rather incorrect.
OrderID should NOT be a column in your Customer table.
It's the other way 'round, you should have a Customer ID in your table Order.
And you should have a table OrderDetail to store your Order Lines.

Review the Northwind sample database.
Also do some research on relational databases and normalization.

RV
 

Users who are viewing this thread

Back
Top Bottom