I have a table with the fields IDNum, DateIn, DateOut.
I want to do a query to show all IDNum that appear 3 or more times in the last 3 months, I have used a query to try to find the data, but I get all items listed 3 or more times, regardless of the date.
My code used was :
SELECT Items.IDNum, Items.datein, Items.dateout
FROM Items
WHERE (((Items.IDNum) In (SELECT [IDNum] FROM [Items] As Tmp GROUP BY [IDNum] HAVING Count(*)>2 )) AND ((Items.datein) Between Date()-90 And Date()))
ORDER BY Items.IDNum;
This was modified from a find duplictaes wizard
I want to do a query to show all IDNum that appear 3 or more times in the last 3 months, I have used a query to try to find the data, but I get all items listed 3 or more times, regardless of the date.
My code used was :
SELECT Items.IDNum, Items.datein, Items.dateout
FROM Items
WHERE (((Items.IDNum) In (SELECT [IDNum] FROM [Items] As Tmp GROUP BY [IDNum] HAVING Count(*)>2 )) AND ((Items.datein) Between Date()-90 And Date()))
ORDER BY Items.IDNum;
This was modified from a find duplictaes wizard