Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access 2003 date/time problem

Status
Not open for further replies.

gcapp

IS-IT--Management
Dec 19, 2006
4
US
Can someone help me??

First time user of this forum and I have a problem.

I have an ASP form that has a field that automatically places the current date into it. It uses the function Date().

The problem I am having is when the form is submitted into my Access database the date is coming out wrong in the Access field. The datatype for the field is Date/Time but it still is not coming out right.

Example: the date in the ASP form shows as 12/19/2006 and the entry in the Access form shows 12:00:27 AM. If I change the format of the Date/Time field to Short Date, the result is: 12/30/1899.

Does anyone know how I can get the data that is posted to the Access database to come out the same as the ASP form??

Any help would be appreciated.
 
I already have the Date/Time field set to General.

Here is my ASP code that inserts that data from the asp form into the database:

<input type="text" name="DateSubmitted" size="15"
value="<%response.write Date() %>"></td>

If Request.Form("posted") = "True" Then
StrDateSubmitted = Request.Form("DateSubmitted") & " "

dlSQL = "INSERT INTO HelpDeskTickets (DateSubmitted)" &_
" VALUES (" & StrDateSubmitted & "')"

Any help would be appreciated


 
First, if you post Access questions in one of the six Access forums, you'll receive more responses.
Also, if my eyes aren't going bad, you're missing a single quote in your post. Was this a typo or is the original missing it too?
dlSQL = "INSERT INTO HelpDeskTickets (DateSubmitted)" &_
" VALUES (" & StrDateSubmitted & "')"
Also, in your input statement, you dim it as text. Probably if you define the field in Access as text, import the data, then change it to date/time, it'll convert corrently. As least it does when importing text files.
Also, in Access, date/times should be enclosed by # signs, eg. #12/20/06#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top