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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add the new record

Status
Not open for further replies.

nina1

Programmer
Aug 14, 2001
31
CA
I have a select query with the new record that should be added across multiple joined tables like:

Tables "local_part", "bill_to" and "customer_part" are joined with one to many relations and now I have a query from sales table with new customer part number and bil_to # .
How can I update the new record like this cust.part no and bill to number or that can be also linking like new customer part numer and old bill to # .

Can somebody can help me with this please?

Thanks
 
We need some more details to give an accurate answer; specifically

[li]Exactly which tables should be updated and with which values? It is not sufficient to say that you have joined them in one-to-many joins. In fact, joins are not one-to-one or one-to-many ... they are whatever is found it the data. That is, there is no join syntax that specifies that the join is one-to-one or one-to-many.[/li]

[li]Do you mean UPDATE or APPEND? That is, are you modifying existing table values or inserting new ones?[/li]

[li]The implication of your statement is that you are duplicating the data for "customer", "part_no" and "bill_to". Why is that happening? Usually the database is designed to store information in only one place and duplication is only for the purpose of establishing relationships among tables.[/li]
 
Sorry I didn't explain the problem completely the first time so now I will try to do it better.
I started the sales database, I have a customer_parts table, local_part table and bill_to table every month end I am going to get a prodact sales report in Excel with the customers part#, local part#, units bil_to # and bill_to location.What I am planing to do is append the records every month in sales table and differentiate them by the month. I figure it out how to find any new cust_part but my problem is if I have the query with the data that should be added to other tables how to do that. Like I have query with new cust_part#, new bill_to# and same local part. How that record can be added across the tables?

I'd appreciate your answer.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top