Date in SQL Insert statement

J

James Brown

Help!

I have an sql INSERT INTO statement that won't work when I include a date
field. Can anyone advise?

I've removed the date field/value and it works fine.
I've enclosed the Date in # characters.
I have a message box which shows the statement before running it and that
looks fine too.

Thanks in advance.

James
 
A

Allen Browne

Is the target field a date/time field?

Make sure you use the US format (regarldless of your regional settings),
e.g. #11/22/2008#.

Post the problem SQL statement if you are still stuck.

Also, tell us how you are executing this, e.g. by running the query, RunSQL
in a macro, or Execute in code.
 
P

Paul Shapiro

If by any chance the SQL is running against a SQL Server db, the syntax for
a literal date is different. Use single quotes surrounding the date literal
instead of #, and enter the date as 'yyyy.mm.dd'.
 

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