Forums
This topic is locked
Date Search in 8.02
Posted 16 Apr 2007 16:51:07
1
has voted
16 Apr 2007 16:51:07 Stephen Bowker posted:
I am trying to do a date search in my Access DatabaseI am using the UK format dd/mm/yyyy and am using POST method in the form
On the results page I have set the LCID to 2057
Here is the code from the Recordset on the results page:
<pre id=code><font face=courier size=2 id=code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Session.LCID=2057%>
<!--#include file="Connections/connHaznm.asp" -->
<%
Dim rsIncident__MMColParam
rsIncident__MMColParam = "01/01/1900"
If (Request.Form("f_Incident_Date" <> "" Then
rsIncident__MMColParam = Request.Form("f_Incident_Date"
End If
%>
<%
Dim rsIncident
Dim rsIncident_cmd
Dim rsIncident_numRows
Set rsIncident_cmd = Server.CreateObject ("ADODB.Command"
rsIncident_cmd.ActiveConnection = MM_connHaznm_STRING
rsIncident_cmd.CommandText = "SELECT * FROM tbl_Term_Contract WHERE f_Incident_Date >= ? ORDER BY f_Incident_Date DESC"
rsIncident_cmd.Prepared = true
rsIncident_cmd.Parameters.Append rsIncident_cmd.CreateParameter("param1", 135, 1, -1, rsIncident__MMColParam) ' adDBTimeStamp
Set rsIncident = rsIncident_cmd.Execute
rsIncident_numRows = 0
%> </font id=code></pre id=code>
It will only accept US date input and even if you reverse the date like so yyyy/mm/dd it still mixes up the days and the months?
anyone any ideas or can they post exisiting working code that I can adapt