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
I'm not sure which SQL you are using. TSQL has a DATEDIFF that will count the number of days between two dates. See this