locked
Error With MsAccess Database RRS feed

  • Question

  • User-455811767 posted

     Hi this srinu,

    iam working with MS ACCESS Database..

    when iam trying to query with aggregate function i have found following error.

    Query:SELECT max(StudentId) FROM Students WHERE Department='Computer Science'

    Error : IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

    My StudentId Column data type  is text,

    Please Help Me.

    Regards 

    srinu

    Saturday, April 11, 2009 5:40 AM

Answers

  • User291159135 posted

    Hi,

    Basically it is saying that you can't do aggregate functions (max, sum,...) on a text field. To do this your studentID field would need to be declared of number type. If it is an ID, you could set it to autonumber. This would automatically increment with each new record, and also ensure that it is unique.

    Hope that helps,

    JC

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 11, 2009 6:57 AM

All replies

  • User291159135 posted

    Hi,

    Basically it is saying that you can't do aggregate functions (max, sum,...) on a text field. To do this your studentID field would need to be declared of number type. If it is an ID, you could set it to autonumber. This would automatically increment with each new record, and also ensure that it is unique.

    Hope that helps,

    JC

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 11, 2009 6:57 AM
  • User-455811767 posted

     Hi Now its Suppoting with Text Field only,i have another Doubt ie

    can we get  the results From Table if i write Query like this 

    i have one table with replicationid equals to guid in sqlserver.

    i wrote query like this select * from students where StudentId='357965A7-5878-4C26-A0F6-05403CBF426A'.(replication id).

    in sqlserver its working but in msaccess its not working,

    please help me

    regards

    srinu

    Saturday, April 11, 2009 7:10 AM