Hi,
I'm trying to update a table with a value coming from a COUNT function in ACCESS. What I need to do is count the number of 'passed' records in the 'ScriptTable' table (value = 'yes') and place that number into the 'EngineCodeName' table.
EngineCodeName has 44 different engine codes and ScriptTable has over 10000 entities but each entity has one of the engine codes as a field.
This is my code:
UPDATE
EngineCodeName SET EngineCodeName.Passed = (SELECT COUNT(ScriptTable.Passed)
FROM ScriptTable HAVING ScriptTable.Passed = YES and ScriptTable.EngineCode = 'ACP')
Where EngineCodeName.EngineCode = 'ACP';
Right now I have it for the EngineCode 'ACP' but what I really need to do is do this for all the different EngineCodes. I was trying something with joins and loops but to no avail.
Any help is appreciated. Thank you.
-Prady
I'm trying to update a table with a value coming from a COUNT function in ACCESS. What I need to do is count the number of 'passed' records in the 'ScriptTable' table (value = 'yes') and place that number into the 'EngineCodeName' table.
EngineCodeName has 44 different engine codes and ScriptTable has over 10000 entities but each entity has one of the engine codes as a field.
This is my code:
UPDATE
EngineCodeName SET EngineCodeName.Passed = (SELECT COUNT(ScriptTable.Passed)
FROM ScriptTable HAVING ScriptTable.Passed = YES and ScriptTable.EngineCode = 'ACP')
Where EngineCodeName.EngineCode = 'ACP';
Right now I have it for the EngineCode 'ACP' but what I really need to do is do this for all the different EngineCodes. I was trying something with joins and loops but to no avail.
Any help is appreciated. Thank you.
-Prady