dates

Discussion in 'ASP .Net' started by James, Jan 25, 2008.

  1. James

    James Guest

    Hello,

    Im having trouble getting information on how to use dates. I have a FormView
    and a AccessDataSource. The Insert command needs to insert the current date
    into one field and a date 1 year from the current date into another
    (registration date and expiry date).

    Searching online I can find GETDATE() and DATEADD() neither seem to work. It
    works fine if I use NOW() or manual type the dates in, but NOW() puts in time
    which I do not want.

    My code is below:
    <asp:AccessDataSource runat=server ID="ADS2" DataFile="~/App_Data/data.mdb"
    InsertCommand="INSERT INTO table([regnumber], firstname, lastname, telephone,
    email, enroldate, expiry, address1, address2, address3, county, postcode)
    VALUES (2, ?, ?, ?, ?, GETDATE(), DATEADD(year,1,GETDATE()), ?, ?, ?, ?, ?)" >

    Any help would be great thanks
    James
     
    James, Jan 25, 2008
    #1
    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. David Lozzi

    Dates dates dates dates... SQL and ASP.NET

    David Lozzi, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    911
    Rob Schieber
    Sep 30, 2005
  2. PW

    Dates! Dates! Dates!

    PW, Aug 7, 2004, in forum: ASP General
    Replies:
    4
    Views:
    235
    Mark Schupp
    Aug 9, 2004
  3. Replies:
    1
    Views:
    240
    Jano Svitok
    Jul 17, 2007
  4. kellygreer1

    RFC-822 dates into Ruby dates

    kellygreer1, Jun 8, 2008, in forum: Ruby
    Replies:
    1
    Views:
    269
    Eric I.
    Jun 8, 2008
  5. Dr J R Stockton

    FAQ Dates; Opera Dates.

    Dr J R Stockton, Jun 18, 2007, in forum: Javascript
    Replies:
    0
    Views:
    191
    Dr J R Stockton
    Jun 18, 2007
Loading...

Share This Page