Page 1 of 1

How to get delivery address *country* onto reports

Posted: 30 Sep 2016, 09:13
by mpfj
I am trying to get the delivery address *country* onto our delivery / invoice reports.

I can get the customer's country code, using COUNTRY_CODE.NAME, but this only gives me the customer registered address.

I currently show the delivery name and address (lines 1-5) using:-

INVOICE.DEL_NAME
INVOICE.DEL_ADDRESS_1
INVOICE.DEL_ADDRESS_2
INVOICE.DEL_ADDRESS_3
INVOICE.DEL_ADDRESS_4
INVOICE.DEL_ADDRESS_5

But I can't work out how to access the country code of the delivery address.

Here's the current joins table:-

[INVOICE]
INNER JOIN [INVOICE_ITEM] ON INVOICE.INVOICE_NUMBER = INVOICE_ITEM.INVOICE_NUMBER
LEFT OUTER JOIN [TAX_CODE] ON INVOICE_ITEM.TAX_CODE = TAX_CODE.TAX_CODE
INNER JOIN [SALES_LEDGER] ON INVOICE.ACCOUNT_REF = SALES_LEDGER.ACCOUNT_REF
INNER JOIN [CURRENCY] ON SALES_LEDGER.CURRENCY = CURRENCY.NUMBER
LEFT OUTER JOIN [STOCK] ON INVOICE_ITEM.STOCK_CODE = STOCK.STOCK_CODE
LEFT OUTER JOIN [PROJECT] AS [INVOICE_ITEM_PROJECT] ON INVOICE_ITEM.PROJECT_ID = INVOICE_ITEM_PROJECT.PROJECT_ID
LEFT OUTER JOIN [COUNTRY_CODE] ON SALES_LEDGER.COUNTRY_CODE = COUNTRY_CODE.CODE
STATIC JOIN [COMPANY]

Any help would be greatly appreciated !!

Regards
Mark J.

Re: How to get delivery address *country* onto reports

Posted: 03 Oct 2016, 14:03
by brucedenney
It can't be done there is no good key between the two data sets, you could try using the delivery address fields all concatenated, but it would be a flaky solution and any change would break things.

Re: How to get delivery address *country* onto reports

Posted: 10 Dec 2016, 19:45
by maxmillion
Because foreign addresses do not match UK address format, I always added the foreign country name to the POSTCODE field which is address field 5.
For most of our foreign customers, they rarely use all 5 fields.