Forum Discussion

gwizzer's avatar
gwizzer
New Member
10 years ago

Append Query (does not work when primary query is empty)

I have two queries which may or may not return rows.  However, if the primary query is empty then when a refresh is issued there is an error 

Column 'anycolumn' in Table 'primaryTable' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.

 

Do you have to create a temporary record ... or is there another method of appending ?

 

5 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    gwizzer wrote:

    I have two queries which may or may not return rows.  However, if the primary query is empty then when a refresh is issued there is an error 

    Column 'anycolumn' in Table 'primaryTable' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.

     

    Do you have to create a temporary record ... or is there another method of appending ?

     


    gwizzer

     

    Based on my test, that error occurs when there exists null values in the "one" table's related column(s).

     

    A solution can be filtering out the null values in "one" table or replacing null with other value.


     

    I don't find this error has anything specific to do with "primary query in apend query return no row". Could you elaborate more details?

     

    If you have any question, feel free to let me know

    • gwizzer's avatar
      gwizzer
      New Member

      HI Eric,

      No Table 1 has no NULL records ... just create the table.  The requirement is that I am appending two task tables into a single view, however, it will happen that either may be blank ... for sure if a record is returned then the ID will not be blank.  I have not tested waht you describe below, and the issue only happens when either table is blank

      • Eric_Zhang's avatar
        Eric_Zhang
        Microsoft Employee

        gwizzer

         

        Can you post a picture of the appended query result and the relationships correlated to the table "PrimaryTable" in your case?