I am trying to count the past 30 days order count but when doing so I get multiples of the same item for each day it was ordered. Is there away to count the past 30 days without list each individual day that it was purchased below is the sql and result example
EX
<tbody>
</tbody>
Code:
SELECT Combine_Orders_ORder_Delivery_Group.ITEM_ID, Count([Combine_Orders_ORder_Delivery_Group]![ITEM_ID]) AS Item_Occurance, Combine_Orders_ORder_Delivery_Group.ORDER_DATE
FROM Combine_Orders_ORder_Delivery_Group
GROUP BY Combine_Orders_ORder_Delivery_Group.ITEM_ID, Combine_Orders_ORder_Delivery_Group.ORDER_DATE
HAVING (((Combine_Orders_ORder_Delivery_Group.ORDER_DATE) Between Date() And DateAdd("m",-1,Date())));
EX
item id | amount | date |
123 | 4 | 11/10/2016 |
123 | 1 | 11/11/2016 |
123 | 7 | 11/12/2016 |
456 | 1 | 11/10/2016 |
456 | 4 | 11/11/2016 |
456 | 3 | 11/12/2016 |
789 | 9 | 11/10/2016 |
789 | 8 | 11/11/2016 |
789 | 4 | 11/12/2016 |
<tbody>
</tbody>