How to add date in access database

Discussion in 'ASP .Net' started by Tony, Feb 27, 2007.

  1. Tony

    Tony Guest

    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?
     
    Tony, Feb 27, 2007
    #1
    1. Advertising

  2. Tony

    Bob Lehmann Guest

    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" <> wrote in message
    news:es1avr$qor$...
    > 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?
    >
    >
    >
    >
     
    Bob Lehmann, Feb 27, 2007
    #2
    1. Advertising

  3. Tony

    Paul Clement Guest

    On Tue, 27 Feb 2007 14:30:50 +0100, "Tony" <> 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)
     
    Paul Clement, Feb 27, 2007
    #3
  4. 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" <> wrote in message
    news:es1avr$qor$...
    >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?
    >
    >
    >
    >
     
    Ignacio Machin \( .NET/ C# MVP \), Feb 27, 2007
    #4
  5. Tony

    Guest

    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" <> wrote in message
    >
    > news:es1avr$qor$...
    >
    > >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, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    643
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,360
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    563
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    753
    Richard Heathfield
    Nov 8, 2003
  5. Matt
    Replies:
    11
    Views:
    423
    Aaron Bertrand [MVP]
    Nov 8, 2003
Loading...

Share This Page