Hello, All
And that's another way of scavenging old events. It requires single query only and seems to be more evident.
DELETE *
FROM tableEvents t
WHERE EXISTS(
SELECT * from tableEvents tt
where tt.TankID=t.TankID
and tt.EventType=0
and tt.DateField>t.DateField);
Well, this is exactly what I've tried.
The first query named CleaningDates uses aggregation function to get last cleaning date for each tank:
SELECT TankID, Max([DateField]) AS LastofDateField
FROM tableEvents
WHERE (((EventType)=0))
GROUP BY tableEvents.TankID;
The SELECT query which shows...
Thank you, David, it was helpful!
I still have to some extent similar question, but I've posted it as a new thread. http://www.access-programmers.co.uk/ubb/Forum3/HTML/003531.html
Hello, All
My database should help to track usage of some kind of tanks. There TWO events that can happen to a tank and that we want to track - event "0" (cleaning) and event "1" (using).
The aim is to delete old events from EventLog table. Event is old, if it had happened before last cleaning...
Hello, All
My database should help to track usage of some kind of tanks. There TWO events that can happen to a tank and that we want to track - event "0" (cleaning) and event "1" (using).
The aim is to count how many times was every tank used after it was cleaned.
All events are entered into...