A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

update query



 
 
Thread Tools Display Modes
  #1  
Old February 26th, 2007, 07:29 AM posted to microsoft.public.access.queries
mccoy
external usenet poster
 
Posts: 32
Default update query

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
  #2  
Old February 26th, 2007, 03:03 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default update query

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" wrote:

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

  #3  
Old February 27th, 2007, 12:26 AM posted to microsoft.public.access.queries
mccoy
external usenet poster
 
Posts: 32
Default update query

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" wrote:

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" wrote:

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

  #4  
Old February 27th, 2007, 05:26 AM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default update query

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" wrote:

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" wrote:

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" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.