That's a really awkward title :)
I need to write a report that generates a list of declines by date. The date is store as a datetime field and is returning the number of declines by datetime.
Here's my SQL:
select ps.date_scheduled, count(*) from payments_schedule ps
left join invoices i on i.invoice_id=ps.invoice_id
left join orders o on o.order_id=i.order_id
where ps.date_scheduled>'2009-06-01 00:00:00'
group by ps.date_scheduled
2009-06-25 14:13:04 1 2009-06-25 14:13:07 1 ..etc...
Not cool. What I want is this: 2009-06-25 25 2009-06-26 31 etc...
How do I do that? Thanks :)