Hi, I'm looking for a little help with nesting a query. I'm running a query in access to search a table with two fields of numbers. One field is "Dose" and the other is "Volume". Below I'm searching for the "Dose" when the "Volume" is equal to a value nearest to 2 and dividing by 100 to get the correct units.
This works fine in returning the value in a single cell ("CentiDose") in the datasheet view. However I want to use update (or at least that's what I think?) to take this value and insert it into a field of one existing record in another table. I think the basic structure of an Update query I want to use looks like this
where the table I want to update is "OAR", the primary key is named "OARSer" and x is the value returned from the other query. I having trouble combining the two queries. I've tried a few ways but I keep getting "operation must use an updateable query" when I try to run it. I'm a complete novice at this and any help would be really appreciated.
Code:
SELECT TOP 1 [Table1]![Dose]/100 AS CentiDose
FROM [Table1]
ORDER BY Abs([Table1]![Volume]-2);
This works fine in returning the value in a single cell ("CentiDose") in the datasheet view. However I want to use update (or at least that's what I think?) to take this value and insert it into a field of one existing record in another table. I think the basic structure of an Update query I want to use looks like this
Code:
UPDATE OAR
SET Field1 = x
WHERE OAR.OARSer = 1;
where the table I want to update is "OAR", the primary key is named "OARSer" and x is the value returned from the other query. I having trouble combining the two queries. I've tried a few ways but I keep getting "operation must use an updateable query" when I try to run it. I'm a complete novice at this and any help would be really appreciated.