The following is the case:
INVOICES contains an autoinc-field "ID" and a integer-field "Invoiceno"
INVOICEDETAILS: only has a reference to INVOICES->"Invoiceno"
On record in INVOICES can have multiple references in table INVOICEDETAILS.
I've added a new field "InvoiceID" to INVOICEDETAILS.
How can I insert the corresponding "ID" from table INVOICES into the field "InvoiceID" in INVOICEDETAILS?
I've tried to do it with following SQL, but that doesn't work.
UPDATE INVOICEDETAILS T1 SET T1.InvoiceID = (Select T2.ID FROM INVOICES T2 WHERE T2.Invoiceno = T1.Invoiceno);
Can anybody give me a solution for this
Thank you very much,