By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,078 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,078 IT Pros & Developers. It's quick & easy.

How to add date in access database

P: n/a
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?


Feb 27 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
"Tony" <to******@hotmail.comwrote in message
news:es**********@magcargo.vodatel.hr...
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?


Feb 27 '07 #2

P: n/a
On Tue, 27 Feb 2007 14:30:50 +0100, "Tony" <to******@hotmail.comwrote:

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)
Feb 27 '07 #3

P: n/a
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.

"Tony" <to******@hotmail.comwrote in message
news:es**********@magcargo.vodatel.hr...
>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?


Feb 27 '07 #4

P: n/a
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

On Feb 27, 2:29 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
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.

"Tony" <tonya...@hotmail.comwrote in message

news:es**********@magcargo.vodatel.hr...
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?

Feb 27 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.