KavJack
Programmer
- Apr 1, 2001
- 46
I need help on Updating a Table. Can anybody fix my UPDATE SQL ?
I have a Table SEASON&Count
which has 3 all numeric fields:SEASON,Number_Of_Teams,Number_Of_Games.
I want to update the Number_Of_Games field which is calculated as the number of games played in a season.
SELECT CUPALL2.YR AS SEASON, Count(CUPALL2.HT) AS CHT
FROM CUPALL2
GROUP BY CUPALL2.YR;
This SQL counts the number of games that are played for each season (CUPALL2.YR) and is stored as a query "SelectYRCount" generating two fields SEASON,CHT.
The UPDATE SQL that I wrote is
UPDATE [SEASON&Count] SET [SEASON&Count].Number_Of_Games = (SELECT CHT FROM SelectYRCount
WHERE SelectYRCount!SEASON = [SEASON&Count]!SEASON);
When I try to run this I get the message "Operation must use an Updatable Query". I am using Access 97 / Windows 98. A bit ancient, I know, but economy prevails right now.
What am I doing wrong ?
I have a Table SEASON&Count
which has 3 all numeric fields:SEASON,Number_Of_Teams,Number_Of_Games.
I want to update the Number_Of_Games field which is calculated as the number of games played in a season.
SELECT CUPALL2.YR AS SEASON, Count(CUPALL2.HT) AS CHT
FROM CUPALL2
GROUP BY CUPALL2.YR;
This SQL counts the number of games that are played for each season (CUPALL2.YR) and is stored as a query "SelectYRCount" generating two fields SEASON,CHT.
The UPDATE SQL that I wrote is
UPDATE [SEASON&Count] SET [SEASON&Count].Number_Of_Games = (SELECT CHT FROM SelectYRCount
WHERE SelectYRCount!SEASON = [SEASON&Count]!SEASON);
When I try to run this I get the message "Operation must use an Updatable Query". I am using Access 97 / Windows 98. A bit ancient, I know, but economy prevails right now.
What am I doing wrong ?