How to add date in access database

T

Tony

I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"

I get message "Syntax error in Insert statement".

How to add date field in access database?
 
B

Bob Lehmann

By enclosing Date in square brackets or renaming the column not using a
reserved word.

SQL = "INSERT INTO GradeList ([Date]) Values(#01-01-2007#)"

SQL = "INSERT INTO GradeList (the_Date) Values(#01-01-2007#)"

Bob Lehmann
 
P

Paul Clement

¤ I am trying this:
¤ SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"
¤
¤ I get message "Syntax error in Insert statement".
¤
¤ How to add date field in access database?

The keyword Date is reserved (it's a function). Use a different name for your column.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

First of all there is no need to post to so many groups at the same time.

Regarding your problem, Date is a reserved word, you have to refer to it as
[Date]
Additionally I would suggest you to use parametered queries.
 
S

susiedba

Ignacio

I suggest you take your C# _CRAP_ and shove it up your ass.

If I want to get your advice, I'll call the cSharp FAGS i promise

your langauge doesn't EXIST





Hi,

First of all there is no need to post to so many groups at the same time.

Regarding your problem, Date is a reserved word, you have to refer to it as
[Date]
Additionally I would suggest you to use parametered queries.


I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"
I get message "Syntax error in Insert statement".
How to add date field in access database?
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top