How to get delivery address *country* onto reports
Posted: 30 Sep 2016, 09:13
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.
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.