Insert Into SQL VBA

前端 未结 1 973
北荒
北荒 2021-01-29 09:52

I am trying to select records that are in the first table but not in the second table and insert them into the second table using a sql statement in VBA. I have started it belo

1条回答
  •  醉话见心
    2021-01-29 10:17

    First, you need supply field list to insert statement:

    INSERT INTO Clients (ClientID)...
    

    Second, your query doesn't insert any rows, because you check ClientID presence in same table. Did you mean someting like next:

    "Where DD.[Client ID] NOT IN (SELECT DD2.[Client ID] FROM " & tableName2 & " as DD2)"
    

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