PC Review


Reply
Thread Tools Rate Thread

How to add date in access database

 
 
Tony
Guest
Posts: n/a
 
      27th Feb 2007
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?




 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      27th Feb 2007
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" <(E-Mail Removed)> wrote in message
news:es1avr$qor$(E-Mail Removed)...
> 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?
>
>
>
>



 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      27th Feb 2007
On Tue, 27 Feb 2007 14:30:50 +0100, "Tony" <(E-Mail Removed)> wrote:

¤ 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)
 
Reply With Quote
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      27th Feb 2007
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" <(E-Mail Removed)> wrote in message
news:es1avr$qor$(E-Mail Removed)...
>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?
>
>
>
>



 
Reply With Quote
 
susiedba@hotmail.com
Guest
Posts: n/a
 
      27th Feb 2007
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.com> wrote:
> 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.com> wrote in message
>
> news:es1avr$qor$(E-Mail Removed)...
>
> >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?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add date in access database Tony Microsoft ADO .NET 5 27th Feb 2007 10:58 PM
How to add date in access database Tony Microsoft VB .NET 4 27th Feb 2007 10:58 PM
How to add date in access database Tony Microsoft ASP .NET 4 27th Feb 2007 10:58 PM
Export Outlook date field as date/time format to Access database =?Utf-8?B?QmVja3k=?= Microsoft Outlook Discussion 0 2nd Dec 2004 02:49 PM
date columns in access database Mr. x Microsoft Access 3 13th Nov 2003 05:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 PM.