AndyC1000
asked on
Aggregating fields based on datetime month and day
Dear all,
I would like to create a monthly and daily queries to aggregate fields, i.e. buildingcost, numberMonths for buildDateTime.
i.e. Montly Aggregate
buildDateTime buildingcost
01/01/2004 00:00:00 9
02/01/2004 00:00:00 10
Returning:
buildDateTime buildingcost
01/2004 19
etc.
I've tried the following without success:
Thanks
I would like to create a monthly and daily queries to aggregate fields, i.e. buildingcost, numberMonths for buildDateTime.
i.e. Montly Aggregate
buildDateTime buildingcost
01/01/2004 00:00:00 9
02/01/2004 00:00:00 10
Returning:
buildDateTime buildingcost
01/2004 19
etc.
I've tried the following without success:
SELECT table1.buildDateTime, SUM(table1.buildingcost), SUM(table1.numberMonths
FROM buildDateTime
WHERE (table1.buildDateTime>= #01/01/2002 00:00:00# AND table1.buildDateTime< #01/12/2002 00:00:00#)
GROUP BY table1.buildDateTime; // how do I specify the month and year
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.