J
Justin
I have entered the following SQL into a query as suggested by Tom
Ellison. When I try to run the query, I get the following error:
Invalid use of '.', '!', '()'. in query expression 'T1.[Truck No] =
T2.[Truck No] AND T1.[Date] = (SELECT MAX([Date]) FROM [Route Sheet]
T3 WHERE t3.[Truck No] = T1.[Truck No] AND t2.[Date] = (SELECT
MAX([Date]) FROM [Route Sheet] T4 WHERE T4.[Truck No] = T2.[Truck No]
AND T2.[Date] < T1.[Date]'.
SELECT T1.[Truck No], T1.Date AS Date1, T2.Date AS Date2, T1.[Ending
Mileage] AS Mileage1, T2.[Ending Mileage] AS Mileage2
FROM [Route Sheet] AS T1, [Route Sheet] AS T2
WHERE T1. [Truck No] = T2. [Truck No] AND T1. [Date] = (SELECT MAX
([Date]) FROM [Route Sheet] T3 WHERE T3. [Truck No] = T1.[Truck No])
AND T2. [ Date] = (SELECT MAX ([Date]) FROM [Route Sheet] T4 WHERE T4.
[Truck No] = T2. [Truck No] AND T2. [Date] < T1.[Date]);
Could someone point out where the problem is?
TIA
Justin
Ellison. When I try to run the query, I get the following error:
Invalid use of '.', '!', '()'. in query expression 'T1.[Truck No] =
T2.[Truck No] AND T1.[Date] = (SELECT MAX([Date]) FROM [Route Sheet]
T3 WHERE t3.[Truck No] = T1.[Truck No] AND t2.[Date] = (SELECT
MAX([Date]) FROM [Route Sheet] T4 WHERE T4.[Truck No] = T2.[Truck No]
AND T2.[Date] < T1.[Date]'.
SELECT T1.[Truck No], T1.Date AS Date1, T2.Date AS Date2, T1.[Ending
Mileage] AS Mileage1, T2.[Ending Mileage] AS Mileage2
FROM [Route Sheet] AS T1, [Route Sheet] AS T2
WHERE T1. [Truck No] = T2. [Truck No] AND T1. [Date] = (SELECT MAX
([Date]) FROM [Route Sheet] T3 WHERE T3. [Truck No] = T1.[Truck No])
AND T2. [ Date] = (SELECT MAX ([Date]) FROM [Route Sheet] T4 WHERE T4.
[Truck No] = T2. [Truck No] AND T2. [Date] < T1.[Date]);
Could someone point out where the problem is?
TIA
Justin