Update Query

  • Thread starter Thread starter Clint
  • Start date Start date
C

Clint

I am trying to update a feild in a table with the sum of
data from another. I had the expression, but accidentally
deleted it. Specifically, I am trying to total training
hours by employee from one table and update each person's
total training hours in another table.
 
You really don't need to store the total training hours as it could (and should)
always be calculated.

But if you feel you MUST do this you will probably need to use the DSum function.

UPDATE SomeTable
Set SomeTable.SomeTotalField =
DSUM("TrainingTime","TrainingTable",
"EmployeeId=""" & SomeTable.EmployeeID & """")

This assumes that EmployeeId is a text field. If it is numeric then drop the
extra quotes.
 
Back
Top