[thelist] help with SQL query

Chris Blessing webguy at mail.rit.edu
Wed Jul 31 10:15:01 CDT 2002


Michael-

Try:

SELECT avg(steps) FROM yourTable GROUP BY ProgramWeek

and:

SELECT avg(steps) FROM yourTable

I may be off, but then again it ain't noon yet. :)

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> I have a SQL Server 2k database that tracks the number of steps
> people walk
> in a day. There is a field for the date [ActivityDate] , number of steps
> [Steps], Week Number [ProgramWeek], user Id [UserID]. What I need
> is to get
> the average number of weekly steps for an individual user.
>
> Working with an unknown number of weeks is it possible to get the average
> for each week then get the avg of all weeks combined in a select
> statement?
>
> The other thing I could do is pass an ASP variable to a view but I don't
> know how to do that.



More information about the thelist mailing list