dates

dates

am 25.01.2008 19:33:00 von James

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:
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