How can I group the following by month and day. I can make it work by months but this groups month in all the years in one record.
SELECT SWD_SCADA_Daily.[Well Name], Sum(SWD_SCADA_Daily.[Water Injection (bbl/day)]) AS CumInjection, Avg(SWD_SCADA_Daily.[Injection Pressure (Psi)]) AS AverageDischargePressure, Avg(SWD_SCADA_Daily.[WHP (Psi)]) AS AverageWHP, MONTH(SWD_SCADA_Daily.[Time/Date]) INTO SWD_SCADA_MONTHLY
FROM SWD_SCADA_Daily
GROUP BY SWD_SCADA_Daily.[Well Name], MONTH(SWD_SCADA_Daily.[Time/Date]);
Thank you.
Microsoft AccessSQL
Last Comment
Paul Cook-Giles
8/22/2022 - Mon
Tomas Helgi Johannsson
Hi,
Move the MONTH(SWD_SCADA_Daily.[Time/Date] colum as the second column in the select.
Regards,
Tomas Helgi
Scott Pletcher
n/a
Aiysha
ASKER
I want to group month and year. Not just the month.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Scott Pletcher
n/a
Aiysha
ASKER
Undefined function 'CONVERT' in expression.
Scott Pletcher
SORRY, I was thinking SQL Server, didn't see the Access tag. I'll remove that and let someone who knows Access comment.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Move the MONTH(SWD_SCADA_Daily.[Tim
Regards,
Tomas Helgi