I am creating two update queries and neither are working right. I am hoping someone has some suggestions to get this to function correctly.
I have two tables
One called edms_batch_info
One called edms_index_history
I want a query to be run on the child tables records edms_index_history and update a parent record field on edms_batch_info
I can not get query 1 to work at all.
Query 2 gives the access error
"You tried to execute a query that does not include the specified expression 'num_of_doc' as part of the aggregate function."
Query 1
UPDATE edms_batch_info
set num_of_doc = Count (edms_index_history.num_of_doc)
from edms_index_history
where edms_index_history.batch_num =edms_batch_info.batch_num;
Query 2
UPDATE edms_batch_info INNER JOIN edms_index_history ON edms_batch_info.batch_num = edms_index_history.batch_num SET edms_batch_info.num_of_doc = Sum(edms_batch_info.num_of_doc)
WHERE (((edms_batch_info.batch_num)=[edms_index_history].[batch_num]));
Any help would be greatly appreciated.
Kat
I have two tables
One called edms_batch_info
One called edms_index_history
I want a query to be run on the child tables records edms_index_history and update a parent record field on edms_batch_info
I can not get query 1 to work at all.
Query 2 gives the access error
"You tried to execute a query that does not include the specified expression 'num_of_doc' as part of the aggregate function."
Query 1
UPDATE edms_batch_info
set num_of_doc = Count (edms_index_history.num_of_doc)
from edms_index_history
where edms_index_history.batch_num =edms_batch_info.batch_num;
Query 2
UPDATE edms_batch_info INNER JOIN edms_index_history ON edms_batch_info.batch_num = edms_index_history.batch_num SET edms_batch_info.num_of_doc = Sum(edms_batch_info.num_of_doc)
WHERE (((edms_batch_info.batch_num)=[edms_index_history].[batch_num]));
Any help would be greatly appreciated.
Kat