Updating data in a table using a query

R

red6000

Hi,

I have a table of data and run a query (see below). What I would like to do
is amend the results in the query data view so that the main table is
updated. Is this possible, if so can you point me in the right direction?
I had looked at using an 'Update' query, but that doesn't appear to be what
i'm after.

Thanks.

SELECT Activities.TaskName, DSum("TimeSpent","Activities","TaskName = '" &
[TaskName] & "'") AS TotalTime
FROM Activities
WHERE (((Activities.WorkDate)=Forms!InputForm2!MainTimesheet.Form!WorkDate)
And ((Activities.CSTRName)=Forms!InputForm2!MainTimesheet.Form!EmployeeID))
GROUP BY Activities.TaskName, Activities.WorkDate
ORDER BY Val(DSum("TimeSpent","Activities","TaskName = '" & [TaskName] &
"'")) DESC;
 
V

Van T. Dinh

If you want to update data in a Table using a Query, an UPDATE query is the
one you need.

However, it may not be a simple process converting from your posted SQL
(which is a Total Query using GROUP BY) to an UPDATE Query depending on
which Field you want to update with which value.

You need to describe your Table details and which Field / which value to use
in the update so that others can suggest a solution. Perhaps a small sample
dataset and the result of the update for the sample dataset would help also.
 

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

Top