Prev: Use Schedule Task to run Updates, but bypass User-Level Security
Next: Access 2007 Append Query – Issue with automatically inserted brack
From: gchichester on 18 May 2010 12:42 I can't seem to figure out why this query will not return any data. SELECT AsiaContracts.AsiaContractShipper, AsiaContracts.AsiaContractShipLine, AsiaContracts.AsiaContractNumber, OceanFreightRate.OceanFreigthRateOriginPort, OceanFreightRate.OceanFreightRateDischargePort, OceanFreightRate. OceanFreightCharge, OceanFreightRate.OceanFreightAdditionalFees, EuropeContracts.EuropeContractShipLine, EuropeContracts.EuropeContractShipper FROM OceanFreightRate INNER JOIN (EuropeContracts INNER JOIN (AsiaContracts INNER JOIN ContractJunction ON AsiaContracts.AsiaContractID = ContractJunction.AsiaContractID) ON EuropeContracts.EuropeContractID = ContractJunction.EuropeContractID) ON OceanFreightRate.OceanFreightRateID = ContractJunction.OceanFreightRateID ORDER BY OceanFreightRate.OceanFreightRateDischargePort; I also posted a screenshot of the design view if anyone needs it. http://advenet.com/photos/cache/1000.2129.3606.640x252.NoResultsQuery.jpg.jpg Thanks any and all suggestions gchichester
From: KARL DEWEY on 18 May 2010 13:42
Your problem is you are using all INNER JOINS where you should be using LEFT JOINS. -- Build a little, test a little. "gchichester" wrote: > I can't seem to figure out why this query will not return any data. > > SELECT AsiaContracts.AsiaContractShipper, AsiaContracts.AsiaContractShipLine, > AsiaContracts.AsiaContractNumber, OceanFreightRate.OceanFreigthRateOriginPort, > OceanFreightRate.OceanFreightRateDischargePort, OceanFreightRate. > OceanFreightCharge, OceanFreightRate.OceanFreightAdditionalFees, > EuropeContracts.EuropeContractShipLine, EuropeContracts.EuropeContractShipper > > FROM OceanFreightRate INNER JOIN (EuropeContracts INNER JOIN (AsiaContracts > INNER JOIN ContractJunction ON AsiaContracts.AsiaContractID = > ContractJunction.AsiaContractID) ON EuropeContracts.EuropeContractID = > ContractJunction.EuropeContractID) ON OceanFreightRate.OceanFreightRateID = > ContractJunction.OceanFreightRateID > ORDER BY OceanFreightRate.OceanFreightRateDischargePort; > > I also posted a screenshot of the design view if anyone needs it. > http://advenet.com/photos/cache/1000.2129.3606.640x252.NoResultsQuery.jpg.jpg > > > Thanks any and all suggestions > gchichester > . > |