Minty
AWF VIP
- Local time
- Today, 03:23
- Joined
- Jul 26, 2013
- Messages
- 10,371
I'm trying to code a bulk update to a table with new records by using an INSERT as follows;
In the immediate window I get the following;
I keep getting an incorrect syntax near '#' error but I thought the dates were formatted correctly. I'm assuming this is another noob beginners error, but can't see it.
Apologies for the awful field names in advance - They can't easily be changed... (Inherited project)
Code:
sSQL_Status = ""
sSQL_Status = sSQL_Status & "INSERT INTO [Copy_Job Details] (Account_No, DelSiteID, [Order Number], [Currency], [Model Number], Manufacturer, [Serial Number], [Stock Code / Part Number], [Repair Price], [RMA Issued Date], [Repair Type], InvStatus, ETA, RepairStart, [RMA Received Date], ShipPriority ) "
sSQL_Status = sSQL_Status & "VALUES ( 1194221, 7553, " & sCurrentOrder & ", " & sCurr & ", " & sPartNo & ", " & sManu & ", " & sSerialNo & ", " & sPartNo & ", 25, #" & strDate & "#, " & sRepairType & ", 1, #" & strDate7 & "#, #" & strDate & "#, #" & strDate & "#, 23)"
In the immediate window I get the following;
Code:
INSERT INTO [Copy_Job Details] (Account_No, DelSiteID, [Order Number], [Currency], [Model Number], Manufacturer, [Serial Number], [Stock Code / Part Number], [Repair Price], [RMA Issued Date], [Repair Type], InvStatus, ETA, RepairStart, [RMA ReINSERT INTO [Copy_Job Details] (Account_No, DelSiteID, [Order Number], [Currency], [Model Number], Manufacturer, [Serial Number], [Stock Code / Part Number], [Repair Price], [RMA Issued Date], [Repair Type], InvStatus, ETA, RepairStart, [RMA Received Date], ShipPriority ) VALUES ( 1194221, 7553, M65407_1, $, MR-L5MQN-02, Quantum, None, MR-L5MQN-02, 25, #10/14/2013#, "Consignment Stock", 1, #10/21/2013#, #10/14/2013#, #10/14/2013#, 23)
I keep getting an incorrect syntax near '#' error but I thought the dates were formatted correctly. I'm assuming this is another noob beginners error, but can't see it.
Apologies for the awful field names in advance - They can't easily be changed... (Inherited project)