SQL-Ledger Homepage

SQL-Ledger User Forum

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How is the shipto table related to the customer table (General)

posted by Gregory West(R) E-mail, Manitoba Canada, 17.05.2016, 16:28

Good afternoon Jeff.

I am looking at the three tables now. I see the trans_id on the shipto table. I can not see the trans_id on the ar table. I have id, customer_id, employee_id, department_id, bank_id and payment_id.

The id on the customer record does not always link to the trans_id in the shipto table. There must be some sort of link I am not seeing, as the shipto addresses show up when I create a sales order, but unfortunately way too many shipto records were created most are exactly the same except some small typo fixed. The question is now how to get rid of all the duplicate records, and adjust pointers to point at the correct record (the one that is left after 3 or 4 are deleted).

Does this make any sense?

Hi Greg

I don't know if you figured this out but here's what I came up with.

The Shipto table has a trans_id number that corresponds to the trans_id
number in the ar table,

In the ar table there is a customer_id number that corresponds to id in the
customer table and to trans_id in the address table giving you the customer
and the mailing address.

Jeff





I have to write a quick query based on the ship to address, to find out
who
the ultimate customer was. My problem is I am having trouble figuring
out
how the shipto table relates to the customer table. ie: If I have a
child shipto record, how do I know who the parent record is?

Anyone have an idea how this is set up?

Gregory A. West

---
Gregory A. West
DB&W Systems Limited

 

Complete thread:

Back to the forum
Board view  Mix view
991 Postings in 327 Threads, 327 registered users, 69 users online (0 registered, 69 guests)
SQL-Ledger User Forum | Admin contact
RSS-Feed
powered by my little forum