S
Song
I have a query like this. I want to modify the query to show top (recent) 5
days for EACH user.
SELECT LCase([EditedBy]) AS [User], DateValue([DateEdited]) AS [Date],
Format([dateedited],"ddd") AS [Day], Count(tblMaster.ID) AS Edited
FROM tblMaster
GROUP BY LCase([EditedBy]), DateValue([DateEdited]),
Format([dateedited],"ddd")
ORDER BY LCase([EditedBy]), DateValue([DateEdited]) DESC;
Result is:
User Date Day Edited
elac_iso 8/1/2008 Fri 61
elac_iso 7/31/2008 Thu 129
elac_iso 7/30/2008 Wed 79
elac_iso 7/29/2008 Tue 23
elac_iso 7/28/2008 Mon 9
elac_iso 7/25/2008 Fri 37
elac_iso 7/24/2008 Thu 82
elac_iso 7/23/2008 Wed 100
wongnc 7/31/2008 Thu 4
wongnc 7/30/2008 Wed 8
wongnc 7/24/2008 Thu 1
wongnc 7/23/2008 Wed 5
wongnc 7/22/2008 Tue 4
wongnc 7/21/2008 Mon 1
wongnc 7/17/2008 Thu 2
wongnc 7/16/2008 Wed 1
wongnc 7/12/2008 Sat 1
wongnc 7/5/2008 Sat 1
wongnc 6/24/2008 Tue 1
wongnc 6/18/2008 Wed 1
days for EACH user.
SELECT LCase([EditedBy]) AS [User], DateValue([DateEdited]) AS [Date],
Format([dateedited],"ddd") AS [Day], Count(tblMaster.ID) AS Edited
FROM tblMaster
GROUP BY LCase([EditedBy]), DateValue([DateEdited]),
Format([dateedited],"ddd")
ORDER BY LCase([EditedBy]), DateValue([DateEdited]) DESC;
Result is:
User Date Day Edited
elac_iso 8/1/2008 Fri 61
elac_iso 7/31/2008 Thu 129
elac_iso 7/30/2008 Wed 79
elac_iso 7/29/2008 Tue 23
elac_iso 7/28/2008 Mon 9
elac_iso 7/25/2008 Fri 37
elac_iso 7/24/2008 Thu 82
elac_iso 7/23/2008 Wed 100
wongnc 7/31/2008 Thu 4
wongnc 7/30/2008 Wed 8
wongnc 7/24/2008 Thu 1
wongnc 7/23/2008 Wed 5
wongnc 7/22/2008 Tue 4
wongnc 7/21/2008 Mon 1
wongnc 7/17/2008 Thu 2
wongnc 7/16/2008 Wed 1
wongnc 7/12/2008 Sat 1
wongnc 7/5/2008 Sat 1
wongnc 6/24/2008 Tue 1
wongnc 6/18/2008 Wed 1