Hi
1st of all i have looked at faqs and i'm still having problems.
I am new to asp and trying solve a problem with dates that are being inserted and then updated in an Access database.
The problem:
entering a UK date 27/01/2003 (27-jan-2003) goes into the database ok.
If the date is 11/01/2003(11-jan-2003) it enters the date as 01/11/2003(01-nov-2003).
No matter what date format I use dd/mm/yyyy or mm/dd/yyyyy
if the day value is less than 13 ie. 1 - 12 then it changes the date format round to be the month.
Here's the form input tag code
<input type="text" name="required_by" size="20" value=" <% =FormatDateTime(now,2)%> ">
It uses the now function as a default date but can be changed by users.
Here's the SQL code
<%
date_reported= request.form("date_reported"
contact_type=request.form("contact_type"
reported_by=request.form("reported_by"
contact_tel=request.form("contact_tel"
branch_name=request.form("branch_name"
problem_type=request.form("selectbox1"
problem_cat=request.form("selectbox2"
required_by=request.form("required_by"
assigned_to=request.form("assigned_to"
notes=request.form("notes"
status=request.form("status"
set conn=Server.CreateObject("ADODB.Connection"
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:\helpdesk.mdb"
'Actual SQL
sql="INSERT INTO logfile(date_reported,contact_type,reported_by,contact_tel,branch,problem_type,problem_cat,required_by,assigned_to,notes,status)" _
& " values('"& date_reported &"'," & "'" & contact_type &"',"&"'" & reported_by & "','" & contact_tel & "','"& branch_name & "','" _
& problem_type & "','" & problem_cat & "','" & required_by & "','" & assigned_to & "','" & notes & "','" & status &"')"
...etc
I have tried using the formatdatetime function around the date when it being INSERT'd into the database.
Please help as it's driving me nuts and is such a basic problem but i can't see where i've gone wrong.
1st of all i have looked at faqs and i'm still having problems.
I am new to asp and trying solve a problem with dates that are being inserted and then updated in an Access database.
The problem:
entering a UK date 27/01/2003 (27-jan-2003) goes into the database ok.
If the date is 11/01/2003(11-jan-2003) it enters the date as 01/11/2003(01-nov-2003).
No matter what date format I use dd/mm/yyyy or mm/dd/yyyyy
if the day value is less than 13 ie. 1 - 12 then it changes the date format round to be the month.
Here's the form input tag code
<input type="text" name="required_by" size="20" value=" <% =FormatDateTime(now,2)%> ">
It uses the now function as a default date but can be changed by users.
Here's the SQL code
<%
date_reported= request.form("date_reported"
contact_type=request.form("contact_type"
reported_by=request.form("reported_by"
contact_tel=request.form("contact_tel"
branch_name=request.form("branch_name"
problem_type=request.form("selectbox1"
problem_cat=request.form("selectbox2"
required_by=request.form("required_by"
assigned_to=request.form("assigned_to"
notes=request.form("notes"
status=request.form("status"
set conn=Server.CreateObject("ADODB.Connection"
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:\helpdesk.mdb"
'Actual SQL
sql="INSERT INTO logfile(date_reported,contact_type,reported_by,contact_tel,branch,problem_type,problem_cat,required_by,assigned_to,notes,status)" _
& " values('"& date_reported &"'," & "'" & contact_type &"',"&"'" & reported_by & "','" & contact_tel & "','"& branch_name & "','" _
& problem_type & "','" & problem_cat & "','" & required_by & "','" & assigned_to & "','" & notes & "','" & status &"')"
...etc
I have tried using the formatdatetime function around the date when it being INSERT'd into the database.
Please help as it's driving me nuts and is such a basic problem but i can't see where i've gone wrong.