update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

anyone who can give me a sample database using update query

i want to update all records using calculated field from another table a sum
of TableA.fieldA to my TableB.fieldB
 
It seems you are attempting to store a value that may change and can be
derived by a calculation. If so, this is generally considered poor practice.
However assuming in Northwind.mdb you want to total each customers Freight
from all Orders and store it in a new field (TotalFreight) in the Customers
table:

UPDATE Customers SET Customers.TotalFreight =
DSum("Freight","Orders","CustomerID='" & [CustomerID] & "'");
 
tnx for the response!

i am trying to update all records from a link table if my way of updating
data is wrong can u give me advice how to do it the right way please...

again tnx..

Duane Hookom said:
It seems you are attempting to store a value that may change and can be
derived by a calculation. If so, this is generally considered poor practice.
However assuming in Northwind.mdb you want to total each customers Freight
from all Orders and store it in a new field (TotalFreight) in the Customers
table:

UPDATE Customers SET Customers.TotalFreight =
DSum("Freight","Orders","CustomerID='" & [CustomerID] & "'");

--
Duane Hookom
Microsoft Access MVP


mccoy said:
anyone who can give me a sample database using update query

i want to update all records using calculated field from another table a sum
of TableA.fieldA to my TableB.fieldB
 
I am not aware of why you are attempting to do what you asked. I made some
assumptions and you didn't seem to confirm or deny my assumption. I gave you
an answer/suggestion. Did it work?
--
Duane Hookom
Microsoft Access MVP


mccoy said:
tnx for the response!

i am trying to update all records from a link table if my way of updating
data is wrong can u give me advice how to do it the right way please...

again tnx..

Duane Hookom said:
It seems you are attempting to store a value that may change and can be
derived by a calculation. If so, this is generally considered poor practice.
However assuming in Northwind.mdb you want to total each customers Freight
from all Orders and store it in a new field (TotalFreight) in the Customers
table:

UPDATE Customers SET Customers.TotalFreight =
DSum("Freight","Orders","CustomerID='" & [CustomerID] & "'");

--
Duane Hookom
Microsoft Access MVP


mccoy said:
anyone who can give me a sample database using update query

i want to update all records using calculated field from another table a sum
of TableA.fieldA to my TableB.fieldB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top