Simply concatenate them, like this:
Dim sSearchDate
sSearchDate = Request.Form("lstYear") & "/" & Request.Form("lstMonth") &
"/" & Request.Form("lstDay")
This assumes that the lst* are dropdowns, containing year(4), month(2) and
day(2) respectively.
You'll end up with something like 2002/05/22 which you can use to compare
with the dates stored in the database.
Here is a small example. The data is hard coded, but you can build it up
like I showed you above:
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\testDatabase.mdb;")
Dim sDate
sDate = "2002/05/22"
Dim sSQL
sSQL = "Select * FROM MyTable WHERE MyDate = #" & sDate & "#"
Dim objRecordset
Set objRecordset = objConn.Execute(sSQL)
If objRecordset.EOF then
Response.Write("Not found")
else
Response.Write("Found")
end if
objRecordset.Close
Set objRecordset = Nothing
objConn.Close
Set objConn = Nothing
This example will print "Found" when the table MyTable has a record with
the column MyDate with the value "2002/05/22"
Using the YYYY/MM/DD format will always work. For example, on my computer,
Access will show 5/22/2002 but I can still compare it with 2002/05/22.
HtH
Imar
At 11:31 PM 5/22/2002 +0000, you wrote:
>Imar,
>
>I just had a thought! If I store ArchiveDate in date type format and as
>one field but in my search form have the date as 3 separate drop/list menu
>fileds - one for day, one for month and one for year - how will the
>system recognise the one field ArchiveDate as the 3 seperate fields??
>
>I am stuck on the code that is required here to call up information by
>date selected using the drop/list menus bearing in mind that I also have a
>search facility for search by keyword and category. How do I combine all 3
>searches into one SQL code???
>
>HELP!!!
>
>Regards,
>
>Sati.