Error in inserting today's date

safeerbinsalih

Registered User.
Local time
Tomorrow, 04:11
Joined
Dec 30, 2015
Messages
26
I'm trying to insert today's date into a table using SQL. But run-time error 3067 is popping out

strSQL = "INSERT INTO tblECO (Release_date)" & vbCrLf & " VALUES (Now()) WHERE ECO_number = (" & E & ")"
db.Execute strSQL, dbFailOnError

In the above code Release_date is date/time(short date) variable and E is Long(double) variable.

Any help is appreciated. Thank you
 
try this:

strSQL = "INSERT INTO tblECO (Release_date) VALUES (#" & Now() & "#) WHERE ECO_number = (" & E & ")"
 
Thanks. But still the same error.
Error is as follows

Run-time error '3067':
Query input must contain at least one table or query
 
sorry, you dont need criteria (where clause) when inserting records.
if you want to update the record, use update query:

strSQL = "UPDATE tblECO SET Release_date = #" & Now() & "# WHERE ECO_number = (" & E & ")"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom