Skip to Content
0
Former Member
Mar 03, 2009 at 09:31 PM

query on BP billing and shipping address

1429 Views

Hello,

I am trying to run a query that will return the tax code field for all ship-to's in a business partner. Reason for doing this is I need to find a particular tax code with the query and replace it using the DTW. My tax code field is only on the ship-to address, but when I run my query using the address fields, I get the billing address as well, even though it doesn't have a tax code field. This is because fields for both the billing and ship-to come from the CRD1 table and have the same field names. Can you tell me how to adjust my query so I can get the BP customer code PLUS all ship-to addresses AND the tax code for each, minus the billing address? I'm not too familiar with grouping and "where" statements.

Here's my query as it stands now:

SELECT T0.[CardCode], T0.[CardName], T0.[U_ABBA_GLDivision], T0.[VatStatus], T1.[Address], T1.[Street], T1.[Block], T1.[City], T1.[State], T1.[TaxCode] FROM OCRD T0 INNER JOIN CRD1 T1 ON T0.CardCode = T1.CardCode

Thanks in advance for your help,

Shelby