Query causes crash

Bratlien

Access Rookie
Local time
Today, 14:39
Joined
Jun 14, 2007
Messages
17
I am managing a traffic database and have currently constructed a series of queries that list average vehicle speed and total volume in five-minute intervals over the course of several months. From each of these queries, I need to create a subquery that, for each time interval, will simply average all speed values and sum all volumes into one record. Fields are: Time, Avg Of Speed, Sum Of Volume.

I created the subquery like so:
Code:
SELECT DISTINCTROW [Speed Weekday (2 SB)].Time, Avg([Speed Weekday (2 SB)].Speed) AS [Avg Of Speed], Sum([Speed Weekday (2 SB)].Volume) AS [Sum Of Volume]
FROM [Speed Weekday (2 SB)]
GROUP BY [Speed Weekday (2 SB)].Time;

When I attempt to switch to datasheet view though, Access locks up every time and I am forced to end the program through the task manager. The query I'm referencing [Speed Weekday (2 SB)] has only 4800 records thus far, so it isn't a ridiculous amount of data. Any advice as to what is going wrong? Thanks in advance for any help!
 
Time is a reserved word in Access and should not be used as an object name. It is possible that this is causing the problem. You would be advised to remove spaces and puntuation from your object names as well.
 
Problem solved! It was an error in the relationships of the original query causing problems displaying the data for the subquery. Thanks for the help though; I have cleaned up my object names now as well.
 

Users who are viewing this thread

Back
Top Bottom