The counts by date range do not seem to add up. For example, the following two queries
https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:"ambien"+AND+serious:1+AND+patient.patientsex:1+AND+[2013-01-01+TO+2014-01-01]&count=patient.reaction.reactionmeddrapt.exact&limit=10
and
https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:"ambien"+AND+serious:1+AND+patient.patientsex:1+AND+[2012-01-01+TO+2013-01-01]&count=patient.reaction.reactionmeddrapt.exact&limit=10
return 46 and 137 for FATIGUE, respectively. However, a query that combines those two date ranges into one, namely
https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:"ambien"+AND+serious:1+AND+patient.patientsex:1+AND+[2012-01-01+TO+2014-01-01]&count=patient.reaction.reactionmeddrapt.exact&limit=10
returns 139 for FATIGUE, instead of 183.
Is this a real issue or a syntax error in the query?
Note that a query avoiding the first day of 2014 (to avoid overlap) does not work at all (I get back "No matches found!")
https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:"ambien"+AND+serious:1+AND+patient.patientsex:1+AND+[2013-01-01+TO+2013-12-31]&count=patient.reaction.reactionmeddrapt.exact&limit=10
This seems to be an outright issue with how dates are handled.
Ron
https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:%22ambien%22+AND+serious:1+AND+patient.patientsex:1+AND+receivedate:[2013-01-01+TO+2013-12-31]&count=patient.reaction.reactionmeddrapt.exact&limit=10