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, 18:26

AH I think I see what is happening now. There is one 'shipto' per order. Duplicates are ignored so each shipto record is it is the same is not shown up twice.

I think I can do a quick down and dirty replace on all the extra records for all the shipto's that are bogus.

Thanks Jay, you are a saviour!

Hi Greg

I thought about this some more and realized that you probably have a bunch
of addresses showing up that are essentially the same when you click on the
shipto button.

The way to get rid of the duplicates is NOT to delete anything from the
shipto table it's to make all of the records in the shipto table the same.


123 cherry Lane
123 Chery Lane
123 Cherry lan

will cause three address to show when you click 'shipto'

Open the Shipto table and make them all the same

123 Cherry Lane

and you'll only get one address in the future because when SQL is searching
for shipto addresses it'll discard duplicates for that customer.

If you don't want to edit the table directly open each invoice from within
SQL-Ledger, edit the shipto address to correct the typo and then re-post



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
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
too many shipto records were created most are exactly the same except
small typo fixed. The question is now how to get rid of all the
records, and adjust pointers to point at the correct record (the one
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
number in the ar table,

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


I have to write a quick query based on the ship to address, to find
the ultimate customer was. My problem is I am having trouble
how the shipto table relates to the customer table. ie: If I have
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
1006 Postings in 335 Threads, 353 registered users, 99 users online (0 registered, 99 guests)
SQL-Ledger User Forum | Admin contact
powered by my little forum