Joining a table with 2 different tables in a query (1 Viewer)

AnilBagga

Member
Local time
Tomorrow, 01:33
Joined
Apr 9, 2020
Messages
223
In the enclosed DB query "qryUncoatedValueAdd" , I need to select a value - UncoatedRate rate from a table 'tblCustFabricConvRates'. The selection is dependent on the CustomerCode (tblCustRFQHdr) and the FGCode from"tblItemMasterPricingSpecs".

The outer joins are posing an error

Can someone advise the cause and solution
 

Attachments

  • PP29Nov.zip
    527.4 KB · Views: 411

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:03
Joined
May 21, 2018
Messages
8,525
I did as the error message suggest. I built two queries. Query 1 is all the tables except the conversion rates. Then created a second query using the first query and the conversion rates table.

Sql for second query
Code:
SELECT
   qryUncoatedValueAdd.Widthpremium,
   qryUncoatedValueAdd.RFQID,
   qryUncoatedValueAdd.RFQDtlsID,
   qryUncoatedValueAdd.EndCustomerCode,
   qryUncoatedValueAdd.UncoatedGSMID,
   tblCustFabricConvRates.UncoatedRate
FROM
   qryUncoatedValueAdd
   LEFT JOIN
      tblCustFabricConvRates
      ON (qryUncoatedValueAdd.EndCustomerCode = tblCustFabricConvRates.CustID)
      AND
      (
         qryUncoatedValueAdd.UncoatedGSMID = tblCustFabricConvRates.StdRateID
      )
 

isladogs

MVP / VIP
Local time
Today, 21:03
Joined
Jan 14, 2017
Messages
18,209
For more information on ambiguous outer joins, see section h) of my web article Query Join Types
 

Users who are viewing this thread

Top Bottom