Click to See Complete Forum and Search --> : insert statement with dates


February 5th, 2000, 02:14 AM
If I have a table called events with two fields: id and date, where id is a number and date (is a general date) and has an input mask that looks like '99/99/00;0;_ , how can I insert a record into the table using SQL?
i.e. shouldn't the following work:

Dim Conn As New ADODB.Connection
Conn.Open "dsn=dsRef"
Conn.Execute ("insert into events (id, date) values (8, #01/01/00#)")
-----------
My error is 'syntax error in INSERT INTO statement'. Maybe I am overlooking something obvious? Any insight would be appreciated!

Much thanks,
msl

Spectre
February 5th, 2000, 10:57 PM
Use the following:
Conn.Execute ("insert into events (id, date) values (8, '01/01/00')")