Convert Null to zero in access database

前端 未结 2 797
一向
一向 2021-01-24 22:28

Considering that Grade.firstExam, Grade.secondExam, and Grade.finalExam are all TEXT and not numbers, i can\'t get the exact solution to convert null values

相关标签:
2条回答
  • 2021-01-24 22:33

    In your SQL try something like this:

    SQLStatement &= "          IIf(IsNull(Grade.firstExam),'0',Grade.firstExam) as 'firstExam', "
    
    0 讨论(0)
  • 2021-01-24 22:53

    You are getting this message error probably because you are using the VB function from inside the SQL request:

    mySQLRequest = "SELECT ..., NZ(yourNumber,0), ..."
    

    the NZ function is not understood by the database engine

    You should write down your request this way:

    mySQLRequest = "SELECT ..., IIf([myField] Is Null,0,[myField]) as myField, ..."
    
    0 讨论(0)
提交回复
热议问题