Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread sum of an average
Thu, Nov 6 2008 1:11 PMPermanent Link

"Sean McDermott"
D7 Pro DBISAM 4.7

select DateReference, avg(AirTemp) as ATAvg from meticedata group by
datereference order by datereference

How do I get a sum of the average daily values? E.g. in pseudo code
"sum(avg(ATAvg))"

Many thanks, Sean

Thu, Nov 6 2008 2:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sean,

<< How do I get a sum of the average daily values? E.g. in pseudo code
"sum(avg(ATAvg))" >>

Do you want just one total number ?  If so, then just use this script:

select DateReference, avg(AirTemp) as ATAvg
INTO "\Memory\temp"
from meticedata
group by datereference
order by datereference;

SELECT SUM(ATAvg) AS AvgTotal
FROM "\Memory\Temp";

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Nov 6 2008 3:55 PMPermanent Link

"Sean McDermott"
Thanks Tim, great service as always, Sean

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:3576CA0D-5425-4F15-96FB-BDDC4D030C5F@news.elevatesoft.com...
> Sean,
>
> << How do I get a sum of the average daily values? E.g. in pseudo code
> "sum(avg(ATAvg))" >>
>
> Do you want just one total number ?  If so, then just use this script:
>
> select DateReference, avg(AirTemp) as ATAvg
> INTO "\Memory\temp"
> from meticedata
> group by datereference
> order by datereference;
>
> SELECT SUM(ATAvg) AS AvgTotal
> FROM "\Memory\Temp";
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Thu, Nov 6 2008 4:16 PMPermanent Link

"Robert"

"Sean McDermott" <Sean@HorizonCanada.com> wrote in message
news:6034AC07-5AA3-440E-AA34-3485B387DB24@news.elevatesoft.com...
> D7 Pro DBISAM 4.7
>
> select DateReference, avg(AirTemp) as ATAvg from meticedata group by
> datereference order by datereference
>
> How do I get a sum of the average daily values? E.g. in pseudo code
> "sum(avg(ATAvg))"
>

Out of curiosity here, what's the purpose of a sum of averages?

Robert

Fri, Nov 7 2008 9:50 AMPermanent Link

"Sean McDermott"
Hi Robert, in this case I am calculating Freezing Degree Days which is based
on an average of many daily temperature values less than zero. But, for one
output I need the total of the FDD numbers to date to back calculate an ice
thickness. Aren't you glad you asked? WinkCheers, Sean

"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote in message
news:F376F80A-BACF-415D-AFF9-535068229122@news.elevatesoft.com...
>
> "Sean McDermott" <Sean@HorizonCanada.com> wrote in message
> news:6034AC07-5AA3-440E-AA34-3485B387DB24@news.elevatesoft.com...
>> D7 Pro DBISAM 4.7
>>
>> select DateReference, avg(AirTemp) as ATAvg from meticedata group by
>> datereference order by datereference
>>
>> How do I get a sum of the average daily values? E.g. in pseudo code
>> "sum(avg(ATAvg))"
>>
>
> Out of curiosity here, what's the purpose of a sum of averages?
>
> Robert
>

Fri, Nov 7 2008 9:56 AMPermanent Link

"Robert"

"Sean McDermott" <Sean@HorizonCanada.com> wrote in message
news:AB3113BB-7670-41E9-A556-B70C2877E102@news.elevatesoft.com...
> Hi Robert, in this case I am calculating Freezing Degree Days which is
> based on an average of many daily temperature values less than zero. But,
> for one output I need the total of the FDD numbers to date to back
> calculate an ice thickness.

Ah, obvious, the old ice thickness calculation. I should have known.

Robert

Fri, Nov 7 2008 10:36 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sean

"This isn't to do with global warming is it?" he asks suspiciously


Roy Lambert
Fri, Nov 7 2008 10:47 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< "This isn't to do with global warming is it?" he asks suspiciously >>

Nah, he's just figuring out when it's safe to hit the pond and play some
hockey. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image