Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select a.KmEnd as CurrentMileage, b.KmEnd as PreviousMileage
from Trips a Inner Join Trips b on
a.RegNo = b.RegNo
where a.KomNo = <Current KomNo>
and b.KomNo < a.KomNo
and not exists (
select * from Trips c
where c.KomNo between b.KomNo and a.KomNo)
SELECT Trips.KomNo, Trips.KomDate, Trips.RegNo, a.KomNo, b.KomNo, a.KmEnd AS CurrentMileage, b.KmEnd AS PreviousMileage
FROM Trips INNER JOIN (Trips AS a INNER JOIN Trips AS b ON a.RegNo = b.RegNo) ON Trips.KomNo = a.KomNo
WHERE (((a.KomNo)=[Trips].[KomNo]) AND ((b.KomNo)<[a].[KomNo]));
The number of records increases 10 times what is normal as not exists c between is not defined but when I try
[Code]
SELECT RouteAvtovozi.KomNo, RouteAvtovozi.KomDate, RouteAvtovozi.RegNo, a.KomNo, b.KomNo, a.KmEnd AS CurrentMileage, b.KmEnd AS PreviousMileage
FROM RouteAvtovozi INNER JOIN (RouteAvtovozi AS a INNER JOIN RouteAvtovozi AS b ON a.RegNo = b.RegNo) ON RouteAvtovozi.KomNo = a.KomNo
WHERE (((a.KomNo)=[RouteAvtovozi].[KomNo]) AND ((b.KomNo)<[a].[KomNo]) AND ((Exists (select * from RouteAvtovozi c where [c].[RegNo] = [a].[RegNo] and c.KomNo between b.KomNo and a.KomNo))=False));
none records appear.
I continue with attempts.
Sanasta