Select data between two dates
I am trying to select records from an Access database that has a date field formatted dd/mm/yyyy format and are between two dates defined in Dim parameters.
The code I have tried is this:
When I execute this script I get the following error:
Dim Today, Future
Today = (Date())
Future = (DateAdd("d",60,Today))
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\access_db\concerts.mdb;"
sql4="SELECT * FROM concert_data WHERE Cncrt_dateasp BETWEEN '" & Today & "' AND '" & Future & "' ORDER BY Cncrt_dateseq DESC"
objRs4.Open sql4, Conn
Repeat1__numRows = -1
Repeat1__index = 0
objRs4_numRows = objRs4_numRows + Repeat1__numRows
"ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/performdates.asp, line 12"
Line 12 = objRs4.Open sql4, Conn
Your help is really appreciated.