Skip to content
Advertisement

Wrong number of Parameters for SQL Update Table

I am trying to add an ID from different table to the table RUSER_KSP_S_TI_ARP

strSQL = "UPDATE RUSER_KSP_S_TI_ARP 
          SET RUSER_KSP_S_TI_ARP.ID_FZG = TI_IDENTIFIKATION.ID_FZG,
              RUSER_KSP_S_TI_ARP.ID_PULK = TI_IDENTIFIKATION.ID_PULK 
              WHERE RUSER_KSP_S_TI_ARP.ARP = TI_IDENTIFIKATION.ARP 
              AND RUSER_KSP_S_TI_ARP.BTNR = TI_IDENTIFIKATION.BTNR;"
CurrentDb.Execute strSQL, dbFailOnError

Returns an Error 3061 saying that it expected 4 parameters and got to few.

Thanks for any help!

Advertisement

Answer

You need to join TI_INDENTIFICATION.

strSQL = "UPDATE ruser
          SET ruser.ID_FZG = ti.ID_FZG,
              ruser.ID_PULK = ti.ID_PULK
          FROM RUSER_KSP_S_TI_ARP ruser
          INNER JOIN TI_IDENTIFIKATION ti
                  ON ruser.ARP = ti.ARP AND ruser.BTNR = ti.BTNR;"
CurrentDb.Execute strSQL, dbFailOnError
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement