I have one table of contact records and I'm trying to get the count of duplicate records that were created on each date. I'm not looking to include the original instance in the count. I'm using SQL Server. Here's an example table
| email | created_on |
| ------------- | ---------- |
| aaa@email.com | 08-16-22 |
| bbb@email.com | 08-16-22 |
| zzz@email.com | 08-16-22 |
| bbb@email.com | 07-12-22 |
| aaa@email.com | 07-12-22 |
| zzz@email.com | 06-08-22 |
| aaa@email.com | 06-08-22 |
| bbb@email.com | 04-21-22 |
And I'm expecting to return
| created_on | dupe_count |
| ---------- | ---------- |
| 08-16-22 | 3 |
| 07-12-22 | 2 |
| 06-08-22 | 0 |
| 04-21-22 | 0 |
Edited to add error message: error message