0
votes

I would like to insert some data into a table in Microsoft Access but I always get the error:

Run-time error '3075':
Syntax error in date in query expression '#10.10.2016'.

This is my SQL query that is sent to the database:

INSERT INTO USECASE_STATUS (usecase_id, usecase_status_txt_id, version, planned_delivery, last_delivery, comment) 
VALUES ( 37, 1, Null, #01.01.2015#, Null, Null)

What is wrong with this statement? The database column planned_delivery and last_delivery are both defined as "Date/Time" - "Short Date".

1

1 Answers

2
votes

The reason for that error is that you have used dots to separate date part from each other. The only date separators accepted in Access query are dash (-) and slash (/).

You need to change your query like that:

INSERT INTO USECASE_STATUS (usecase_id, usecase_status_txt_id, version, planned_delivery, last_delivery, comment) 
VALUES ( 37, 1, Null, #01-01-2015#, Null, Null)

or

INSERT INTO USECASE_STATUS (usecase_id, usecase_status_txt_id, version, planned_delivery, last_delivery, comment) 
VALUES ( 37, 1, Null, #01/01/2015#, Null, Null)