Conversion Failure, Lock Failure with SQL Statement

M

Matthew

I am trying to run the following SQL statement
INSERT INTO [Tithe Information] VALUES ("7/14/2005", "Mmusquiz", "Matthew",
"Musquiz", "100", "Building", 0);

The first column in the table is a Date then the following three columns are
text, next is a currency, then a text, then an auto number (the 0 in the SQL
statement)

I don't know how to not put anything in the autonumber field and still get
it to populate, and I am getting all these errors when it tries to append to
the table.....Can anyone help??? Thanks in advance.....
 
D

Douglas J. Steele

You need to list the names of the fields (ignoring the name of the
autonumber field), and only include values for those fields that you list.
As well, assuming you're trying to insert into a Jet database, you need to
delimit the date with #, not quotes:

INSERT INTO [Tithe Information] (Field1, Field2, Field3, Field4, Field5,
Field6)
VALUES (#7/14/2005#, "Mmusquiz", "Matthew", "Musquiz", "100", "Building");
 
V

Van T. Dinh

A small amendment, the 5th Field is currency so I guess it should be 100
rather than "100".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top