0

I am getting a circular reference caused by 'qrySectorAX'. From the following code:

SELECT qryIntervalSectorAX.SectorID, qryIntervalSectorAX.UnitID, Count(qryIntervalSectorAX.[Length]) AS NoOfWeights, (Sum([Length]*([AX]-[WeightedAX])^2)/(([NoOfWeights]-1)/[NoOfWeights]*Sum([Length])))^0.5 AS WeightedSD
FROM qryIntervalSectorAX INNER JOIN qrySectorAX ON qryIntervalSectorAX.UnitID = qrySectorAX.UnitID AND qryIntervalSectorAX.SectorID = qrySectorAX.SectorID
GROUP BY qryIntervalSectorAX.SectorID, qryIntervalSectorAX.UnitID;

Can anyone help?

RSJ85
  • 9
  • 3
  • Nope, trying to calculate those in this query. – RSJ85 Jul 28 '16 at 14:54
  • Not that I can spot. I think it has something to do with the version of Access Im using as I never had a problem with this database when I last used it a couple of years ago. – RSJ85 Jul 28 '16 at 15:37
  • Try explicitly referencing `[Length]`, `[Ax]`, and `[WeightedAX]`. For example, `qryIntervalSectorAX.Length` – random_answer_guy Jul 28 '16 at 15:41
  • try removing things until it works. `Select * FROM qryIntervalSectorAX INNER JOIN qrySectorAX ON qryIntervalSectorAX.UnitID = qrySectorAX.UnitID AND qryIntervalSectorAX.SectorID = qrySectorAX.SectorID GROUP BY qryIntervalSectorAX.SectorID, qryIntervalSectorAX.UnitID;` and if that doesn't work, take the group by out, and if that doesn't work take the join out. Keep peeling it back until something works – Brad Jul 28 '16 at 19:55
  • Replace *NoOfWeights* in your Sum function by *Count(qryIntervalSectorAX.[Length])* and see if that makes a difference – Rene Jul 28 '16 at 21:47

0 Answers0