Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Update Query - with Count function

Status
Not open for further replies.

klarkee

MIS
Dec 9, 2001
1
GB
tryin to run an update query to my Price Band Table, where I want to COUNT the number of stores in the store data table, where the Price Band ID is equal in both tables.

I have been able to run this as a normal query:-

SELECT [Store Data Table].[Price Band ID], Count([Store Data Table].[Price Band ID]) AS Expr1,
FROM [Store Data Table]
GROUP BY [Store Data Table].[Price Band ID];

However to run this as an update query, I am unable to get it to work.
 
klarkee,
It's impossible to use this as an update, since each row is actually many rows aggregated together. You could use it as a sub-select statement in the criteria of another update query to update bulk sets of rows based on some aggregate value.
--Jim
 
What your trying will not work. Use your select statement as query1. Then create an update query and link the query1 to Price Brand table and setting [price band id] equal to each other.

Nordyck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top