Different Starting/Ending month for Quarters

student_101

New member
Local time
Today, 05:19
Joined
Jan 29, 2009
Messages
1
Hi guys,

I am working on a time-frequency converter in VB6 with Access as my database, and using SQL to query different options selected by the user.

I have hourly data for many years, and I get different outputs in hourly, daily, weekly, monthly, quarterly, bi-yearly and yearly averages, their counts, st_dev and etc.

Most of it works fine, but I need help with this part.

1) The user wants to select different months for the quarter, for example, instead of the default JFM as quarter 1, they may select FMA, I have to text boxes to get the start and end in the format of MM/YYYY from starting at ending, but I dont know how to change these settings for the quarters.

2) Is there any way to gey bi-yearly (half year) data, such as average, and the same problem as above, different starting and ending months.

This is the code I have for the quarterly data.

Code:
SELECT DatePart("q",[date]) AS Quarter, tbl_operation.cYear, Avg(tbl_operation.Value) AS Average, Count(tbl_operation.Value) AS n, StDev(tbl_operation.Value) AS St_Dev
FROM tbl_operation
GROUP BY DatePart("q",[date]), tbl_operation.cYear
ORDER BY tbl_operation.cYear;
Your help will be much appreciated ! :)
 

Users who are viewing this thread

Back
Top Bottom