You are here: Re: Hourly Average « MsSQL Server « IT news, forums, messages
Re: Hourly Average

Posted by Roy Harvey on 08/17/06 16:41

I believe this will do it.

SELECT Location,
dateadd(hour,datediff(hour,0,TimeDate),0) as Hourly,
avg(Data) as AvgData
FROM .....
GROUP BY
Location,
dateadd(hour,datediff(hour,0,TimeDate),0)

Roy Harvey
Beacon Falls, CT

On 17 Aug 2006 09:31:32 -0700, "Compliance" <comcontrol@aol.com>
wrote:

>Apologies for the simplicity of the question, but it reflects my
>capabilities! I have the following sample fields coming from different
>tables:
>
>Location
>TimeDate (timestamp)
>Data
>
>I need to return the average of Data per Location per HOUR.
>
>Thanks.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация