I looked at the below question and it gets me half way there. I can run Suyash Gandhi's code and it will count the total number of emails with a certain label for all of time. I am trying to get a count for (A) # of emails sent and (B) # emails received by label for a specific date.
For example,
Label Date #Received #Sent
Test 1/1/2017 2 4
Test 1/2/2017 2 4
Test 1/3/2017 2 4
Test 1/4/2017 2 0
Test 1/10/2017 2 8
Vs what the code currently does:
Label Date Count
Test 1/10/2017 30
I'd like to run the script say at midnight to count the prior days emails.