Lightwave
Ad astra
- Local time
- Today, 19:11
- Joined
- Sep 27, 2004
- Messages
- 1,537
Dear All,
I'm trying to create a database to time races in Access 2003.
The background is that competitors (actually triathletes) start and then go round a lap or circuit coming back to the same location. Thus the raw information is race numbers and times. The race numbers are allocated to people and every lap a race number is given a time. I’ve managed to rank the times so that I get effective laps (using information from within here) my next stumbling block is having a (semi live cross tab query on the resultant lap table)
At a basic level I have two tables
TableParticipants
RaceNo
FirstName
Surname
And a further table which contains the times of each lap
TableLapTimes
RaceNo
LapTime
I then have a query that runs the following SQL
SELECT L1.*, (SELECT Count(L2.Raceno) from LapTimes as L2
WHERE L1.Raceno = L2.Raceno AND L1.Time> L2.Time)+1 AS LapNumber
FROM LapTimes AS L1;
This calculates the number of laps each competitor has done.
and returns the competitors
The Raceno
The LapNumber
and the LapTime
I was thinking that I would next create a cross tab query that would allow me to more efficiently identify how each competitor has done relative to the next.
This is where I’m hitting a problem there is something in the SQL that means that when I do this I get the following error message
The Microsoft Jet database engine does not recognize 'L1.Raceno' as a valid field name or expression.
The confusing thing is that the field marked RaceNo (subsequent to the SQL that calculates the laps) must have an alias nomenculture behind the scenes because if I do a make table query after the SQL and then run a cross tab on the made table there’s no problem. Does anyone have any pointers on how I could solve this problem. I’m guessing maybe re-write the SQL or possibly do it in a different way?
I haven’t got time at the moment but if people need I can post a simplified version of the database with error message.
Thanks in advance Mark
I'm trying to create a database to time races in Access 2003.
The background is that competitors (actually triathletes) start and then go round a lap or circuit coming back to the same location. Thus the raw information is race numbers and times. The race numbers are allocated to people and every lap a race number is given a time. I’ve managed to rank the times so that I get effective laps (using information from within here) my next stumbling block is having a (semi live cross tab query on the resultant lap table)
At a basic level I have two tables
TableParticipants
RaceNo
FirstName
Surname
And a further table which contains the times of each lap
TableLapTimes
RaceNo
LapTime
I then have a query that runs the following SQL
SELECT L1.*, (SELECT Count(L2.Raceno) from LapTimes as L2
WHERE L1.Raceno = L2.Raceno AND L1.Time> L2.Time)+1 AS LapNumber
FROM LapTimes AS L1;
This calculates the number of laps each competitor has done.
and returns the competitors
The Raceno
The LapNumber
and the LapTime
I was thinking that I would next create a cross tab query that would allow me to more efficiently identify how each competitor has done relative to the next.
This is where I’m hitting a problem there is something in the SQL that means that when I do this I get the following error message
The Microsoft Jet database engine does not recognize 'L1.Raceno' as a valid field name or expression.
The confusing thing is that the field marked RaceNo (subsequent to the SQL that calculates the laps) must have an alias nomenculture behind the scenes because if I do a make table query after the SQL and then run a cross tab on the made table there’s no problem. Does anyone have any pointers on how I could solve this problem. I’m guessing maybe re-write the SQL or possibly do it in a different way?
I haven’t got time at the moment but if people need I can post a simplified version of the database with error message.
Thanks in advance Mark
Last edited: