How would I go about grouping a set of data by a defined period? Let's say I have data from year 2010 - 2012, and I want to pull data that is grouped by every 15 days, 5 weeks, 6 months, whatever time period?
This should achieve what you want, just change the number 60 to the number of days you want to group by, and change the field and table names to match your data.
Code:
SELECT Int(([[COLOR=red]DateFieldName[/COLOR]]-DMin("[COLOR=red]DateFieldName[/COLOR]","[COLOR=red]TableName[/COLOR]"))/60) AS DateGroup
FROM [COLOR=red]TableName
[/COLOR]GROUP BY Int(([[COLOR=#ff0000]DateFieldName[/COLOR]]-DMin("[COLOR=#ff0000]DateFieldName[/COLOR]","[COLOR=#ff0000]TableName[/COLOR]"))/60);