Microsoft
Software
Hardware
Network
Question : MS Access calculate rolling 12 month average
In an Access query how do I calculate a rolling 12 month average for a field that contains numerical data such as 1, 2, 3. The fields are Date (month/year), number of injuries, and the 3rd column will contain a rolling 12 month average for the past 12 months.
Answer : MS Access calculate rolling 12 month average
Use a criterium like:
where [YourDateField] between DateAdd("yyyy", -1, Date()) and Date()
If [YourDateField] is not of data type Date you will have to convert it to a valid date value using DateValue or DateSerial.
/gustav
Random Solutions
What is a 'Database consistency check'?
How can I enable a template item accoding to query result ?
Retrieve drivers before wipe?
Why does EE not allow file uploads with the .accdb extension?
Access 2003 between date query - want to select the date also typed in
How to put range in excel cell?
how to make changes to a mandatory profile
Using ADO to connect to a database: Factors preventing connection
Data Set Extract
SQL code conversion for Microsoft Access 2007