I'm trying to pull in some SAP SQL data through the OLEDB Connect 32 connector, but I'm running into an error when it comes to the Business Partner data table generated through a Left Join containing query. My other tables using the same connector work fine and this Query also works fine when run Microsoft SQL Server Management Studio.
BPMaster:
SQL SELECT OCRD.[GroupCode],
OCRD.[CardCode],
OCRD.[CardName],
OCRD.[SlpCode],
OCRD.[CardType],
OCRG.[GroupCode],
OCRG.[GroupName],
OSLP.[SlpCode],
OSLP.[SlpName]
FROM OCRD
LEFT JOIN OCRG ON OCRD.[GroupCode] = OCRG.[GroupCode]
LEFT JOIN OSLP ON OCRD.[SlpCode] = OSLP.[SlpCode];
Use a LOAD statement before doing the SELECT and make sure you get every field only once, and also that the field spelling is case sensitive.
Alternatively, run the three selects separately (OCRD, OCRG and OSLP) and verify that the results are expected.
Use a LOAD statement before doing the SELECT and make sure you get every field only once, and also that the field spelling is case sensitive.
Alternatively, run the three selects separately (OCRD, OCRG and OSLP) and verify that the results are expected.
mbaeyens Thanks it was due to GroupCode and SlpCode appearing twice.
BPMaster:
SQL SELECT OCRD.[GroupCode] AS 'GrpCode',
OCRD.[CardCode],
OCRD.[CardName],
OCRD.[SlpCode] AS 'SalespCode',
OCRD.[CardType],
OCRG.[GroupCode],
OCRG.[GroupName],
OSLP.[SlpCode],
OSLP.[SlpName],
FROM OCRD
LEFT JOIN OCRG ON OCRD.[GroupCode] = OCRG.[GroupCode]
LEFT JOIN OSLP ON OCRD.[SlpCode] = OSLP.[SlpCode];