john33john33
Registered User.
- Local time
- Tomorrow, 04:44
- Joined
- Jul 23, 2015
- Messages
- 18
[solved]how to group by academic/user-defined year
This is further application on: htt p://www[dot]access-programmers[dot]co[dot]uk/forums/showthread.php?t=279458
A quicker look, here is a query:
And the result is grouped by normal year, Year(ElectricityUsage.Occurrence).
How to make it group by academic year, let say from july-june.
Then it would be 2011/2012, 2012/2013...
Thanks
This is further application on: htt p://www[dot]access-programmers[dot]co[dot]uk/forums/showthread.php?t=279458
A quicker look, here is a query:
Code:
SELECT ElectricityUser.UserName, Year(ElectricityUsage.[Occurrence]) AS [Year], Round(Sum(ElectricityUsage.amount*(SELECT TOP 1 CO2Emission from ElectricityEmissionFactor
WHERE year(ElectricityEmissionFactor.[Occurrence]) <= year(Occurrence) order by ElectricityEmissionFactor.[Occurrence] desc
)),0) AS CO2
FROM ElectricityUser INNER JOIN ElectricityUsage ON ElectricityUser.UserID = ElectricityUsage.UserID
WHERE (((ElectricityUser.UserName)<>"Whole Campus"))
GROUP BY ElectricityUser.UserName, Year(ElectricityUsage.Occurrence);
How to make it group by academic year, let say from july-june.
Then it would be 2011/2012, 2012/2013...
Thanks
Last edited: