I'm trying to query the data in 4 tables :
TAFCBHISTPED = NUPED, DTEMIS
TAFGRPROD = CDGRPR, DSGRPR
TAFPROD = CDPROD, CDGRPR
TAFITHISTPED = NUPED, CDPROD, QTPED
My query looked like this:
SELECT
TAFCBHISTPED.NUPED,
TAFCBHISTPED.DTEMIS,
TAFGRPROD.CDGRPR,
TAFGRPROD.DSGRPR,
TAFPROD.CDPROD,
TAFPROD.CDGRPR,
TAFITHISTPED.NUPED,
TAFITHISTPED.CDPROD,
TAFITHISTPED.QTPED
FROM dbo.TAFCBHISTPED
INNER JOIN dbo.TAFITHISTPED ON TAFCBHISTPED.NUPED = TAFITHISTPED.NUPED
LEFT JOIN dbo.TAFPROD ON TAFGRPROD.CDGRPR = TAFPROD.CDGRPR
But I get the following error:
SQLState: 42000 Error Code: 4104 Message: [Microsoft] [ODBC Driver 13 for SQL Server] [SQL Server] The multipart identifier " TAFGRPROD.CDGRPR " can not be associated.