8

I am trying to use the StDev function and am getting blank results. I am using it as...

SELECT StDev(fldMean) FROM myTable

Where fldMean contains a value of 2.3 and should evaluate to 0 but instead I am simply getting an empty result. I can't seem to understand how expressions are to be used in the function, Microsoft's manual really didn't help.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
codingManiac
  • 1,654
  • 4
  • 29
  • 42

1 Answers1

12
SELECT StDev(fldMean) FROM myTable

will return Null if [myTable] has only one row because the Standard Deviation cannot be computed from a single observation. You will need at least two rows in that table before you can receive a meaningful result. If you want to force the Null value to zero you can use

SELECT Nz(StDev(fldMean), 0) FROM myTable
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418