on 09-30-2008 6:57 PM
Ship Address gets stored in one field address in OINV or ORDR Table
any way to link that to master Address table to get address separated by address1,address2,city,state and zip
or any other thoughts
Absolutely,
The example below will give you the link between the Sales Order Shipping Address and and BP Master Address table
SELECT DISTINCT T1.Address AS 'Address Name', T1.Street AS 'Street', T1.Block AS 'Block',
T1.City AS 'City', T1.State AS 'State', T1.ZipCode AS 'Zip Code', T1.CardCode AS 'BP Code'
FROM [dbo].[ORDR] T0 INNER JOIN [dbo].[CRD1] T1 ON T0.CardCode = T1.CardCode
WHERE T0.ShipToCode = T1.Address AND T1.AdresType = 'S'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This query will pull the address components from crd1 as they exists at the time the query is run, not when the order/invoice was posted. Just a warning.
Since there is nothing to stop a user from editing an existing address, this query could returned a parsed address that is different in every respect except address name and address type from the address that was actually used for the order or invoice on the logistics tab.
If what you really need is the parsed out address from the logistics tab, you have some work ahead of you. I've got a rudimentary parser that I have written, and it works fairly well for US addresses, but for international addresses, due to differences in logistics tab address formats, it breaks down.
Do you want these addresses beside your sales report?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
109 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.