Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL -- getting hourly averages of 15 minute bars
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01593483
Message ID:
01593484
Views:
56
>Hello, I have a table that collects a rating, every 15 minutes
>
>
>mhour	mmin	mRating
>1	        0015	1.76
>1	        0030	1.72
>1	        0045	1.66
>1	        0100	1.64
>2	        0115	        1.64
>2	        0130	1.62
>2	        0145	1.7
>
>
>And I would like to use SQL to generate an average of the mRatings, for each hour.
>
>
>mhour	AvgRating
>1	        1.695
>2	        1.653       
>
>
>Is this possible?
>Thank you,
>Steve

Sure, what seems to be the problem?
select mHour, avg(mRating) as AvgRating from Ratings GROUP BY mHour
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform