I have the following need
I have a logging table which logs som leads generated each day.
Now I need to pull a report over the amount of leads for each day over
When you cast a DateTime to an int it "truncates" at noon, you might want to strip the day out like so
cast(DATEADD(DAY, DATEDIFF(DAY, 0, created_date), 0) as int) as DayBucket