AVG() SQL function. Help please

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

Hi. I have the following sql statement:
SELECT AVG(grade) FROM tblEvalGrades WHERE SSN='123456789'

I get the following error when trying to output my table
in my datagrid:
ERROR: Decimal byte array constructor requires an array
of length four containing valid decimal bytes

The grades that I have are GPAs. I am using an Access
database, and the field grade is Precision 4, Scale 2,
and Decimal Places 2. Could someone tell me what I need
to do to get rid of the error. Thank you in advance.

Steven
 
It appears that you have set the FieldSize of the Grade field to Decimal.
The value you put in the Precision property is the total number of digits
that can stored, both to the left and right of the decimal point. The Scale
property is the number of If you have set the Precision to 4 and the result
of the Avg function turns out to be 85.32479, then Access is possibly going
to balk. If I were you I would simply change the FieldSize to Double and,
then, you won't have to worry about the precision.
 
Back
Top