R
robboll
What about a query that only displays the last three entries by date.
So instead of
Unit Value Date
a 10 09/18/2005
a 12 10/17/2005
a 14 11/11/2005
a 20 11/21/2005
a 19 12/23/2005
b 19 10/14/2005
b 14 12/17/2005
b 18 02/10/2006
b 20 03/13/2006
b 21 03/29/2006
We see:
Unit Value Date
a 14 11/11/2005
a 20 11/21/2005
a 19 12/23/2005
b 18 02/10/2006
b 20 03/13/2006
b 21 03/29/2006
Where it only displays the last three entries for each unit.
What I have so far is:
SELECT L.Unit, L.DATE, L.Value
FROM Sheet1 AS L
WHERE (((L.DATE) In (select top 3 L.DATE
from
Sheet1 M
WHERE
M.unit= L.unit
ORDER BY L.unit, L.Date)));
Any tips appreciated!
robboll
So instead of
Unit Value Date
a 10 09/18/2005
a 12 10/17/2005
a 14 11/11/2005
a 20 11/21/2005
a 19 12/23/2005
b 19 10/14/2005
b 14 12/17/2005
b 18 02/10/2006
b 20 03/13/2006
b 21 03/29/2006
We see:
Unit Value Date
a 14 11/11/2005
a 20 11/21/2005
a 19 12/23/2005
b 18 02/10/2006
b 20 03/13/2006
b 21 03/29/2006
Where it only displays the last three entries for each unit.
What I have so far is:
SELECT L.Unit, L.DATE, L.Value
FROM Sheet1 AS L
WHERE (((L.DATE) In (select top 3 L.DATE
from
Sheet1 M
WHERE
M.unit= L.unit
ORDER BY L.unit, L.Date)));
Any tips appreciated!
robboll