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

Update query with 4 tables

Status
Not open for further replies.

cbh35711

Programmer
Dec 12, 2005
28
US
I've gotten help on a similar query from SantaMufasa before on this forum. For some reason I seem otherwise inept to change that query to fit what I want to do now.

So, I've got a table I want to update(indirect_customer_copy). It has DEA and COT, I want to update the unknown COT based on DEA. The next table(indirect_sales) has DEA and agreement_id. The next table(Agreement_id_to_cot) has agreement_id and COT. So I'd like it to pull a list of DEAs that are unknown, then figure out each agreement_id. The problem is a DEA may have more than one agreement_id, so it would take the multiple agreement_ids and figure out the COT from Agreement_id_to_cot table and then use COT_importance, a table that has COT and its importance(1-20, 1 being the best), to choose the COT.

Here's the previous thread.

Thanks for your help,

Chris
 
Chris said:
I seem otherwise inept to change that query to fit what I want to do now.
Chris, can you please post the code that you've tried to modify, that "didn't work"?

If it resulted in a syntax or run-time error, then post the error, as well.

If it resulted in a logic (bad-results) error, then please explain what about the results did not meet your expectations.


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top