Get last 7 days Record in Web SQl database

I am using this query , please help me how to get record of last 7 days in web sql database , i am using intel xdk

SELECT count(dosedetailid) as totaldose, sum(taken_dose) as taken, sum(skipped_dose) as skipped, sum(dismissed_dose) as dismissed FROM dosedetails WHERE createdate >= DATE(createdate - INTERVAL 7 DAY)";