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
This depends on what SQL server you're using.
If you're using MS-SQL Server, you can use the function DateDiff