[thelist] help with SQL query

Michael Robertson mike at mikeemedia.com
Wed Jul 31 11:43:01 CDT 2002


thanks so much for all of your help

This seems to return what I want on a week by week basis

SELECT avg(steps) FROM tblRecordSteps where UserID='777' GROUP BY
ProgramWeek

Can i get an overall average from this - I tried using this as a subquery
and got an error

Thanks

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''

----- Original Message -----
From: "Chris Blessing" <webguy at mail.rit.edu>
To: <thelist at lists.evolt.org>
Sent: Wednesday, July 31, 2002 11:19 AM
Subject: RE: [thelist] help with SQL query


> 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.
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>




More information about the thelist mailing list