And then change the sSQL to separate your variables from your string text
sSQL = "SELECT * FROM LogSheet WHERE " & _
"(DateIN >= #" & strStartDate & _
"# AND DateIN <= #" & strEndDate & "#)"
And if you are getting the dates from a user form entry using
strStartDate = Request.Form("StartDate")
strEndDate = Request.Form("EndDate")
Make sure you really have a valid date for each date or the code will generate an error
If Not IsDate(strStartDate) OR Not IsDate(strEndDate) Then
' send them back to the form for valid date entries
End If
--
| Change
|
| strStartDate = Request.QueryString("StartDate")
| strEndDate = Request.QueryString("EndDate")
|
| To
|
| strStartDate = Request.Form("StartDate")
| strEndDate = Request.Form("EndDate")
| --
| ==============================================
| Thomas A. Rowe (Microsoft MVP - FrontPage)
| ==============================================
| If you feel your current issue is a results of installing
| a Service Pack or security update, please contact
| Microsoft Product Support Services:
|
http://support.microsoft.com
| If the problem can be shown to have been caused by a
| security update, then there is usually no charge for the call.
| ==============================================
|
| | >I think I am very close to the answer but I am still having a problem.
| > I am using the POST method of a Form to send the StartDate and EndDate
| > to another page that tries to print out the Data. The first page is a
| > basic form that posts to the new page. But when the new page comes up
| > it can't query anything because the Dates aren't coming into the sSQL
| > statement. They are actually showing up as #::strStartDate::# for
| > example. Here is my code for the report page
| >
| > dim strStartDate
| > dim strEndDate
| >
| > strStartDate = Request.QueryString("StartDate")
| > strEndDate = Request.QueryString("EndDate")
| > Set Conn = Server.CreateObject("ADODB.Connection")
| > Set Rs = Server.CreateObject("ADODB.RecordSet")
| > Conn.Open "MaterialEstimating"
| > sSQL = "SELECT * FROM LogSheet WHERE (DateIN >= #::strStartDate::# AND
| > DateIN <= #::strEndDate::#)"
| > Set Rs = Conn.Execute(sSQL)
| > Do While NOT Rs.EOF
| >
|
|