Clueless Newbie
Immortal. So far.
- Local time
- Today, 10:11
- Joined
- Feb 6, 2004
- Messages
- 48
Hi all!
I'm trying to transfer data between two tables. This is the corresponding query:
INSERT INTO tblData ( KundenNr, AngebotNr, LaufzeitSAP, SAPAuftragsWert )
SELECT tblExcelimport.Debitor, tblExcelimport.SaM, tblExcelimport.Laufzeit, tblExcelimport.Wert
FROM tblExcelimport
WHERE (((tblExcelimport.Laufzeit)=9999) AND ((tblExcelimport.Wert)=0));
The problem is that tblData contains an ID field whose value needs to be unique, but unfortunately it's not an auto-increment type. So far, tblData.ID is simply = 0 for every recordset I add through the above query - which of course is not acceptable. (tblExcelimport has no ID field so far, but of course I could add one and adjust my query accordingly.)
Is there any way to determine DMax("[ID]", "tblData"), let tblExcelimport.ID count up from there and then insert those recordsets into tblData, or something along that line?
Probably sounds daft to you experts, but I'm lost... Any ideas would be most appreciated. Thank you!
Ute
I'm trying to transfer data between two tables. This is the corresponding query:
INSERT INTO tblData ( KundenNr, AngebotNr, LaufzeitSAP, SAPAuftragsWert )
SELECT tblExcelimport.Debitor, tblExcelimport.SaM, tblExcelimport.Laufzeit, tblExcelimport.Wert
FROM tblExcelimport
WHERE (((tblExcelimport.Laufzeit)=9999) AND ((tblExcelimport.Wert)=0));
The problem is that tblData contains an ID field whose value needs to be unique, but unfortunately it's not an auto-increment type. So far, tblData.ID is simply = 0 for every recordset I add through the above query - which of course is not acceptable. (tblExcelimport has no ID field so far, but of course I could add one and adjust my query accordingly.)
Is there any way to determine DMax("[ID]", "tblData"), let tblExcelimport.ID count up from there and then insert those recordsets into tblData, or something along that line?
Probably sounds daft to you experts, but I'm lost... Any ideas would be most appreciated. Thank you!
Ute