PC Review


Reply
Thread Tools Rate Thread

#Error when using stDev in query

 
 
noel_juaire@msn.com
Guest
Posts: n/a
 
      4th May 2007
I am getting an error when running a query with StDev in Access. Most
rows have a good calc value, but 2 rows have an #Error value. When I
try to sort by the StDev column I get an overflow error, I also get
overflow errors when I try to run a query based on this query. The
same things happen when I use the var function. The data in the
column has no null values and is a valid numeric data type (currency).

Here is the query:
SELECT Code, Count(t1.acct) AS CountOfAcct, Min(t1.totalchgs) AS
MinOftotalchgs, Max(t1.totalchgs) AS MaxOftotalchgs,
Avg(Bhtn_ipvol.totalchgs) AS AvgOftotalchgs, stdev(t1.totalchgs) AS
StDevOftotalchgs
FROM t1
GROUP BY Code


Here is a snippet of the data:
Code CountOfacct MinOftotalchgs MaxOftotalchgs AvgOftotalchgs
StDevOftotalchgs
372 613 $3,064.40 $64,121.21 $10,186.93 5274.24
373 3422 $1,547.35 $99,172.31 $8,266.91 #Error
374 45 $4,480.93 $27,785.28 $11,476.62 4729.02


If I calculate the StDev manually, I do not get an error, but it takes
a VERY LONG time to complete the query.

Any insight would be helpful.

 
Reply With Quote
 
 
 
 
Michel Walsh
Guest
Posts: n/a
 
      7th May 2007
If memory serves, stDev involves a division by n-1, n being the number of
records. So, if there is just one record in the group, the standard
deviation is not defined (since the whole sampling of one record is already
used to approximate the mean, and that we cannot derive TWO different
information, the mean and the deviation, where there is just ONE present,
initially, ... we are doomed in the case a group has only one record, as per
getting its deviation is required).


Hoping it may help,
Vanderghast, Access MVP



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am getting an error when running a query with StDev in Access. Most
> rows have a good calc value, but 2 rows have an #Error value. When I
> try to sort by the StDev column I get an overflow error, I also get
> overflow errors when I try to run a query based on this query. The
> same things happen when I use the var function. The data in the
> column has no null values and is a valid numeric data type (currency).
>
> Here is the query:
> SELECT Code, Count(t1.acct) AS CountOfAcct, Min(t1.totalchgs) AS
> MinOftotalchgs, Max(t1.totalchgs) AS MaxOftotalchgs,
> Avg(Bhtn_ipvol.totalchgs) AS AvgOftotalchgs, stdev(t1.totalchgs) AS
> StDevOftotalchgs
> FROM t1
> GROUP BY Code
>
>
> Here is a snippet of the data:
> Code CountOfacct MinOftotalchgs MaxOftotalchgs AvgOftotalchgs
> StDevOftotalchgs
> 372 613 $3,064.40 $64,121.21 $10,186.93 5274.24
> 373 3422 $1,547.35 $99,172.31 $8,266.91 #Error
> 374 45 $4,480.93 $27,785.28 $11,476.62 4729.02
>
>
> If I calculate the StDev manually, I do not get an error, but it takes
> a VERY LONG time to complete the query.
>
> Any insight would be helpful.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate the stdev of an array using text as the criteria Crypes Microsoft Excel Worksheet Functions 4 25th Feb 2009 07:12 PM
Using STDEV to evaluate a subset of a population jdunnisher Microsoft Excel Worksheet Functions 6 6th Sep 2008 08:08 AM
StDev Query Zack Barresse Microsoft Access Queries 2 12th Apr 2006 07:22 PM
GET NON-ZERO RESULTS USING STDEV FOR CERTAIN NUMBERS =?Utf-8?B?Tm9uLXplcm8gcmV0dXJuIGZvciBTdGRldg==?= Microsoft Excel Worksheet Functions 2 16th Dec 2004 09:44 AM
Use of StDev in query Rodney Microsoft Access Queries 1 2nd Sep 2003 01:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:10 AM.