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

Posted by Compliance on 08/17/06 18:24

Roy:

Thanks for the reply! I have run this and am getting a syntax error on
the second line which says there is incorrect syntax near the '(' . I
played with spacing but could not resolve. Do you have any tips?
Also, is it inappropriate

Roy Harvey wrote:
> 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

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