No value given for the required parameter

后端 未结 2 734
陌清茗
陌清茗 2020-12-21 13:33

I am trying to run the qry below against an access database and I get an error No value Given for the required parameter?

SELECT        ID, DateColumn, Less9         


        
相关标签:
2条回答
  • 2020-12-21 14:14

    The usual cause for this is that you have misspelled one of the field names, and, thus, Access thinks it is a parameter (which is not specified).

    There are two ways to fix this:

    • Manually check evey field name, to make sure it is spelled correctly or
    • start removing fields from your query until the problem disappears. The last field removed is the culprit.
    0 讨论(0)
  • 2020-12-21 14:16

    You have typed one of your columns incorrectly, and Access thinks you are trying to pass a parameter.

    Go over your field names again and make sure they have all been entered correctly.

    I believe the problem may be this:

    SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365) 
                     AS Total
    

    And then you refer to it later as Total here:

    SUM(Between180365) / Total
    

    Access can't take the alias and re-use it in the query, you need this:

    SUM(Between180365) / 
        (SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365))
    

    Also make sure you handle the denominator so you don't divide by zero.

    0 讨论(0)
提交回复
热议问题