0

I am unable to understand why my Update Query takes only the value in the last row and puts it in all other, in the same column.

Here are pictures:

update query 1

update query 2

So, I need to calculate percent(PBrojProdPoTip), given BrojProdPoTip and VkBrojProdPoTip which is the sum.

PBrojProdPoTip = BrojProdPoTip * 100 / VkBrojProdPoTip 

If you try the last value, 244 out of 18248 gives 01.34%

P = 244 * 100 / 18248 = 1.34%

What do I do wrong? Why it takes only one value?

Vlad
  • 2,739
  • 7
  • 49
  • 100

3 Answers3

5

You have a Cartesian (multiplying) query.

It probably updates using all of the values of VkBrojProdPoTip. However, each one overwrites the previous one, thus you only see the last update.

Gustav
  • 53,498
  • 7
  • 29
  • 55
  • Perhaps this is the right answer, however I found much better solution. The main table which I fill with data, already contained the values, so i just removed helper table T10_nezbirni and replaced its value with [T10-promet].[BrojProdPoTip]. I will add the answer. – Vlad Jul 04 '17 at 12:13
1

Long, long time since I've used an Access Query Design to do this, but I am sure your problem is that you have created no relationships between the three tables. As a result all the fields in the target table are updated with all the answers from your calculation. In practice they end up all getting the last value calculated. Instead you need to create links between the tables, which you can do by drag and drop.

Jonathan Willcock
  • 5,012
  • 3
  • 20
  • 31
0

I found much better solution. The main table which I fill with data, already contained the values, so i just removed helper table T10_nezbirni and replaced its values with [T10-promet].[BrojProdPoTip].

Here is a screenshot:

update query 3

Vlad
  • 2,739
  • 7
  • 49
  • 100