SQL: count days in date range?

Posted by John Isaacks on Stack Overflow See other posts from Stack Overflow or by John Isaacks
Published on 2010-04-08T17:34:17Z Indexed on 2010/04/08 17:43 UTC
Read the original article Hit count: 182

Filed under:
|
|

I have a query like this:

SELECT COUNT(*) AS amount
FROM daily_individual_tracking
WHERE sales = 'YES'
AND daily_individual_tracking_date BETWEEN '2010-01-01' AND '2010-03-31'

I am selected from a date range. Is there a way to also get the total days in the date range?

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql