Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to add date in access database

Reply
Thread Tools

How to add date in access database

 
 
Tony
Guest
Posts: n/a
 
      02-27-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
 
      02-27-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
 
      02-27-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
 
      02-27-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
 
      02-27-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" <(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
 
 
 
Reply

Thread Tools

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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM



Advertisments