dates

J

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top