Hello,
I have the following query that provides the data I need from a table with name, date, and mark; however I can't seem to figure out how to limit the query output to only the last 10 marks by date per name. (The query simply gets all marks from last month and only those >=50 further than last month - this works fine) Can anyone point me in the right direction? Here is what I have so far...
SELECT DISTINCT A.name, A.mdate, A.mark
FROM [SELECT data.name, data.mdate, data.mark FROM DATA
WHERE ((DATA.mdate Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0)))
UNION
SELECT data.name, data.mdate, data.mark FROM DATA
WHERE ((DATA.mdate<DateSerial(Year(Date()),Month(Date())-1,1)) AND ((DATA.mark)>=50))]. AS A;
Thanks!
I have the following query that provides the data I need from a table with name, date, and mark; however I can't seem to figure out how to limit the query output to only the last 10 marks by date per name. (The query simply gets all marks from last month and only those >=50 further than last month - this works fine) Can anyone point me in the right direction? Here is what I have so far...
SELECT DISTINCT A.name, A.mdate, A.mark
FROM [SELECT data.name, data.mdate, data.mark FROM DATA
WHERE ((DATA.mdate Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0)))
UNION
SELECT data.name, data.mdate, data.mark FROM DATA
WHERE ((DATA.mdate<DateSerial(Year(Date()),Month(Date())-1,1)) AND ((DATA.mark)>=50))]. AS A;
Thanks!