Hello, I’m trying to add an SQL command that sends the records from a table (All Diagnostics) that have the check box “True” and the Date, to another table (Patient Diagnostics). However, when debugging the code, the message appears: “Basic execution error. The argument is not optional” (line two).
The code I am using is as follows:
Sub do_sql(sql as string)
sql = "INSERT INTO ""3003. Diagnosticos de Enfermagem do Paciente""(""ID_DE"", ""Data"") SELECT ""ID_DE"",""Data"" FROM ""3003. Diagnosticos de enfermagem"", ""Datas do Diagnostico"" WHERE ""3003. Diagnosticos de enfermagem"".""Selecionar"" = TRUE"
oresult = ThisDataBaseDocument.DataSource.getconnection("","").createstatement.executequery(sql)
End Sub