J
Jey
Hi,
Thanks in advance if someone can show me how to do this!
I'm storing GPS collar data for radio-collared animals.
My table is called GPSLocations, and has fields:
GPS_ID
Individual_ID
Date
LatWGS84
LongWGS84
(plus more that don't apply to this problem)
I have a query to extract the last GPS locate date for each individual:
SELECT GPSLocations.Individual_ID, Max(GPSLocations.Date) AS MaxOfDate
FROM GPSLocations
GROUP BY GPSLocations.Individual_ID;
....but I want to modify it to also show the lat/long of that locate.
I've looked at: http://www.mvps.org/access/queries/qry0020.htm
but my query is complicated by also having a GROUP BY clause.
I've tried things like:
SELECT Q.Individual_ID, Q.Date, Q.LatWGS84, Q.LongWGS84
FROM GPSLocations As Q
WHERE Q.Date = (SELECT T.Individual_ID, Max(T.Date) AS MaxofDate
FROM GPSLocations As T
WHERE T.GPS_ID = Q.GPS_ID
GROUP BY T.Individual_ID)
GROUP BY Q.Individual_ID;
I just can't get it to work! Is it even possible to do in one query, or will
I have to use more than one?
Jey
Thanks in advance if someone can show me how to do this!
I'm storing GPS collar data for radio-collared animals.
My table is called GPSLocations, and has fields:
GPS_ID
Individual_ID
Date
LatWGS84
LongWGS84
(plus more that don't apply to this problem)
I have a query to extract the last GPS locate date for each individual:
SELECT GPSLocations.Individual_ID, Max(GPSLocations.Date) AS MaxOfDate
FROM GPSLocations
GROUP BY GPSLocations.Individual_ID;
....but I want to modify it to also show the lat/long of that locate.
I've looked at: http://www.mvps.org/access/queries/qry0020.htm
but my query is complicated by also having a GROUP BY clause.
I've tried things like:
SELECT Q.Individual_ID, Q.Date, Q.LatWGS84, Q.LongWGS84
FROM GPSLocations As Q
WHERE Q.Date = (SELECT T.Individual_ID, Max(T.Date) AS MaxofDate
FROM GPSLocations As T
WHERE T.GPS_ID = Q.GPS_ID
GROUP BY T.Individual_ID)
GROUP BY Q.Individual_ID;
I just can't get it to work! Is it even possible to do in one query, or will
I have to use more than one?
Jey