Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching the database for a certain time period 2

Status
Not open for further replies.

bikebanditcom

Programmer
Jun 11, 2003
117
US
Guys,

i'm trying to display results from a recordset based on a date range the user provides in two text boxes. the following bit of code is my recordsets defined, anyone have any idea how to do this? thanks

<%
Dim rsAuditInfo__MMColParam
rsAuditInfo__MMColParam = &quot;1&quot;
If (Request.QueryString(&quot;date1&quot;) <> &quot;&quot;) Then
rsAuditInfo__MMColParam = Request.QueryString(&quot;date1&quot;)
End If
%>
<%
Dim rsAuditInfo
Dim rsAuditInfo_numRows

Set rsAuditInfo = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsAuditInfo.ActiveConnection = MM_admin_STRING
rsAuditInfo.Source = &quot;SELECT * FROM tblAudits WHERE auditDate LIKE '%&quot; + Replace(rsAuditInfo__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;%' ORDER BY letter ASC&quot;
rsAuditInfo.CursorType = 0
rsAuditInfo.CursorLocation = 2
rsAuditInfo.LockType = 1
rsAuditInfo_Open()

rsAuditInfo_numRows = 0
%>
<%
Dim rsAuditorInfo__MMColParam
rsAuditorInfo__MMColParam = &quot;1&quot;
If (Request.QueryString(&quot;date1&quot;) <> &quot;&quot;) Then
rsAuditorInfo__MMColParam = Request.QueryString(&quot;date1&quot;)
End If
%>
<%
Dim rsAuditorInfo
Dim rsAuditorInfo_numRows

Set rsAuditorInfo = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsAuditorInfo.ActiveConnection = MM_admin_STRING
rsAuditorInfo.Source = &quot;SELECT * FROM qAuditorInfo WHERE auditDateByDay LIKE '%&quot; + Replace(rsAuditorInfo__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;%'&quot;
rsAuditorInfo.CursorType = 0
rsAuditorInfo.CursorLocation = 2
rsAuditorInfo.LockType = 1
rsAuditorInfo_Open()

rsAuditorInfo_numRows = 0
%>
<%
Dim rsErrorRate__MMColParam
rsErrorRate__MMColParam = &quot;1&quot;
If (Request.QueryString(&quot;date1&quot;) <> &quot;&quot;) Then
rsErrorRate__MMColParam = Request.QueryString(&quot;date1&quot;)
End If
%>
<%
Dim rsErrorRate
Dim rsErrorRate_numRows

Set rsErrorRate = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsErrorRate.ActiveConnection = MM_admin_STRING
rsErrorRate.Source = &quot;SELECT * FROM qErrorRate WHERE auditDateByDay LIKE '%&quot; + Replace(rsErrorRate__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;%'&quot;
rsErrorRate.CursorType = 0
rsErrorRate.CursorLocation = 2
rsErrorRate.LockType = 1
rsErrorRate.Open()

rsErrorRate_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsAuditInfo_numRows = rsAuditInfo_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = -1
Repeat2__index = 0
rsAuditorInfo_numRows = rsAuditorInfo_numRows + Repeat2__numRows
%>
<%
Dim Repeat4__numRows
Dim Repeat4__index

Repeat4__numRows = -1
Repeat4__index = 0
rsErrorRate_numRows = rsErrorRate_numRows + Repeat4__numRows
%>





 
IF you want to find a Date Range in the database then the quickest way to perfomr that task wil probably be the BETWEEN operator

eg:
sql = &quot;SELECT * FROM table WHERE DateFiled BETWEEN #&quot; & DateFrom & &quot;# AND #&quot; & DateTo & &quot;#&quot;

validating the date is your main objective also. The format is going to be DB sensitive more then likely or the query will either error out or reulst with no records

what type of database is it?
what format is the user required to submit the dates?
are you actually looking for a exact date like &quot;07/25/2003&quot;
or the actual range from like &quot;07/20/2003 to 07/25/2003&quot;


____________________________________________________
Python????? The other programming language you never thought of!
thread333-584700

onpnt2.gif
 
You'll have much more success developing database driven pages if you write your own code. Dreamweaver has it's place but if you rely on it to be right all the time you're going to spend a lot of time debugging or asking &quot;what's wrong with my code&quot;.
 
thanks for the advice veep, i'm learning as i'm using dreamweaver because i have deadlines, only code i'm letting dreamweaver write is the recordsets, but i can write that also and i will begin, i'm slowly only using dm for a text editor, i like the color codes it gives everything, tried ultraedit that didnt work, got web matrix and think i'll convert to .net soon so i can use that. thx onpt for the advice, i'll test this out monday, shoudl i have dateFrom and dateTo the names of the textboxes submitting the dates? i'm a little lost where the connection from the textbox and the next page is? or better said i dont understand how to declare a variable that is the form submission, is that what you've done. thanks everyone
dan
 
onpt that was a great post, i wasn't sure how to use that at all, i'd been able to in access queries but wasn't sure how to use it in my pages but still need to understand variables. i'll read up on it. thanks
 
Here's a quick example of what onpnt was saying along with retrieving your post and assigning to variables and some (very) simple validation:

<%
BeginDate = request.Form(&quot;BeginDate&quot;)
EndDate = request.Form(&quot;EndDate&quot;)
showSQL = FALSE
if request.Form(&quot;flag&quot;) <> &quot;&quot; then
flag = request.Form(&quot;flag&quot;)
End if
If flag = 1 then
strSql=&quot;SELECT * FROM myTable WHERE myDATE BETWEEN #&quot; & BeginDate & &quot;# AND #&quot; & EndDate & &quot;#&quot;
strSql2=&quot;SELECT * FROM myTable WHERE myDATE BETWEEN '&quot; & BeginDate & &quot;' AND '&quot; & EndDate & &quot;'&quot;
showSQL = TRUE
END IF
%>
<html>
<head>
<title>Date Demo</title>
</head>
<body>
<form name=&quot;frmDate&quot; action=&quot;<%=REQUEST.SERVERVARIABLES(&quot;SCRIPT_NAME&quot;)%>&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;flag&quot; value=&quot;1&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;38%&quot; style=&quot;font-family:tahoma;font-size:11px;&quot;>
<div align=&quot;right&quot;>Start Date</div>
</td>
<td width=&quot;12%&quot;>
<div align=&quot;right&quot;>
<input type=&quot;text&quot; name=&quot;BeginDate&quot; value=&quot;<%=BeginDate%>&quot; style=&quot;font-family:tahoma;font-size:11px;height:18px;width:75px;&quot;>
</div>
</td>
<td rowspan=&quot;2&quot; width=&quot;45%&quot; valign=&quot;middle&quot;>
<input type=&quot;submit&quot; name=&quot;btnGo&quot; value=&quot;Go&quot; onClick=&quot;CheckDate()&quot; style=&quot;font-family:tahoma;font-size:11px;height:18px;width:25px;color:blue;&quot;>
</td>
</tr>
<tr>
<td width=&quot;38%&quot; style=&quot;font-family:tahoma;font-size:11px;&quot;>
<div align=&quot;right&quot;>End Date</div>
</td>
<td width=&quot;12%&quot;>
<div align=&quot;right&quot;>
<input type=&quot;text&quot; name=&quot;EndDate&quot; value=&quot;<%=EndDate%>&quot; style=&quot;font-family:tahoma;font-size:11px;height:18px;width:75px;&quot;>
</div>
</td>
</tr>
<tr>
<td colspan=&quot;3&quot; align=&quot;center&quot; style=&quot;font-family:tahoma;font-size:11px;&quot;><%IF showSQL then%><strong>MS Access SQL:</strong> <%=strSql%><%else%> <%end if%></td>
</tr>
<tr>
<td colspan=&quot;3&quot; align=&quot;center&quot; style=&quot;font-family:tahoma;font-size:11px;&quot;><%IF showSQL then%><strong>SQL Server SQL:</strong> <%=strSql2%><%else%> <%end if%></td>
</tr>
</table>
<script language=&quot;vbscript&quot;>
frmDate.BeginDate.focus
sub CheckDate()
if len(frmDate.BeginDate.value)=0 then
alert &quot;Please Select a Start Date!&quot;
window.event.returnvalue=false
frmDate.BeginDate.focus
exit sub
end if
if len(frmDate.EndDate.value)=0 then
alert &quot;Please Select a End Date!&quot;
window.event.returnvalue=false
frmDate.EndDate.focus
exit sub
end if
End Sub
</script>
</form>
</body>
</html>
 
guys im still completely lost here, i've tried to changing my recordsets that dreamweaver has written for me but i am not able to get it to work can anyone give me an example based on the code above? thank you.

dan
 
thanks alot for the help guys, i'll email and post the pages for the forms benefit

this is page one auditstats.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;time_nav_js.txt&quot;-->
<html>
<head>
<title>Audit Statistics</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;return_style.css&quot;>

</head>
<body>
<h1>Audit Statistics</h1>
<!--#include file=&quot;time_nav.txt&quot;-->
<h4>Enter A Date Below (examples: 7/14/2003, 7/14)</h4>
<form action=&quot;take_auditStats.asp&quot;>
<p>
<input name=&quot;beginDate&quot; type=&quot;text&quot; id=&quot;date1&quot; value=&quot;<%= date() %>&quot; size=&quot;12&quot;>
And
<input name=&quot;endDate&quot; type=&quot;text&quot; id=&quot;date2&quot; value=&quot;<%= date() %>&quot; size=&quot;12&quot;>
<input type=&quot;submit&quot; name=&quot;Submit2&quot; value=&quot;Submit&quot; method=&quot;post&quot;>
</p>
</form>
<hr>

</body>
</html>



this is page two take_auditstats.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/admin.asp&quot; -->
<%
beginDate = Request.Form(&quot;beginDate&quot;)
endDate = Request.Form(&quot;endDate&quot;)
%>
<%
Dim rsAuditInfo
Dim rsAuditInfo_numRows

Set rsAuditInfo = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsAuditInfo.ActiveConnection = MM_admin_STRING
rsAuditInfo.Source = &quot;SELECT * FROM tblAudits WHERE auditDate BETWEEN '&quot; & DateFrom & &quot;' AND '&quot; & DateTo & &quot;'&quot;
rsAuditInfo.CursorType = 0
rsAuditInfo.CursorLocation = 2
rsAuditInfo.LockType = 1
rsAuditInfo_Open()

rsAuditInfo_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsAuditInfo_numRows = rsAuditInfo_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = -1
Repeat2__index = 0
rsAuditorInfo_numRows = rsAuditorInfo_numRows + Repeat2__numRows
%>
<%
Dim Repeat4__numRows
Dim Repeat4__index

Repeat4__numRows = -1
Repeat4__index = 0
rsErrorRate_numRows = rsErrorRate_numRows + Repeat4__numRows
%>
<html>
<head>
<title>Audit Statistics</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charsAuditoret=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;return_style.css&quot;>
</head>
<body>
<h1>Audit Statistics</h1>
<!--#include file=&quot;time_nav.txt&quot;-->
<table width=&quot;740&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;740&quot; height=&quot;23&quot; valign=&quot;top&quot;><hr color=&quot;#006699&quot;> </td>
</tr>
</table>
<table width=&quot;385&quot; border=&quot;1&quot; bordercolor=&quot;#006699&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<% If Not rsAuditInfo.EOF Or Not rsAuditInfo.BOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;40&quot; height=&quot;46&quot;>
<div align=&quot;center&quot;>Letter</div></td>
<td width=&quot;50&quot;>
<div align=&quot;center&quot;>Auditor</div></td>
<td width=&quot;79&quot;>
<div align=&quot;center&quot;># Of Orders</div></td>
<td width=&quot;86&quot;>
<div align=&quot;center&quot;># Of Errors</div></td>
<td width=&quot;77&quot;>
<div align=&quot;center&quot;>Complete?</div></td>
</tr>
<% End If ' end Not rsAuditInfo.EOF Or NOT rsAuditInfo.BOF %>

<%
While ((Repeat1__numRows <> 0) AND (NOT rsAuditInfo.EOF))
%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;28&quot;><font size=&quot;2&quot;><%=(rsAuditInfo.Fields.Item(&quot;letter&quot;).Value)%>&nbsp;</font></td>
<td><font size=&quot;2&quot;><%=(rsAuditInfo.Fields.Item(&quot;auditor&quot;).Value)%>&nbsp;</font></td>
<td><font size=&quot;2&quot;><%=(rsAuditInfo.Fields.Item(&quot;numAudited&quot;).Value)%>&nbsp;</font></td>
<td><font size=&quot;2&quot;>&nbsp;<%=(rsAuditInfo.Fields.Item(&quot;numOrdErr&quot;).Value)%></font></td>
<td valign=&quot;top&quot;><font size=&quot;2&quot;><%=(rsAuditInfo.Fields.Item(&quot;orderComp&quot;).Value)%></font></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAuditInfo.MoveNext()
Wend
%>
</table>



<table width=&quot;740&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;387&quot; height=&quot;21&quot; valign=&quot;top&quot;>
<% If rsAuditInfo.EOF And rsAuditInfo.BOF Then %>
No Records to Display for that day, please try again
<% End If ' end rsAuditInfo.EOF And rsAuditInfo.BOF %> </td>
<td width=&quot;353&quot;></td>
</tr>
<tr>
<td height=&quot;2&quot;></td>
<td></td>
</tr>
</table>


<table width=&quot;353&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#006699&quot;>
<!--DWLayoutTable-->
<% If Not rsAuditorInfo.EOF Or Not rsAuditorInfo.BOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;123&quot; height=&quot;54&quot;><div align=&quot;center&quot;>Auditor</div></td>
<td width=&quot;74&quot; align=&quot;center&quot; valign=&quot;middle&quot;>
<div align=&quot;center&quot;># Of Orders Audited</div></td>
<td width=&quot;124&quot; align=&quot;center&quot; valign=&quot;middle&quot;>
<div align=&quot;center&quot;># Of Errors Found</div></td>
</tr>
<% End If ' end Not rsAuditorInfo.EOF Or NOT rsAuditorInfo.BOF %>

<%
While ((Repeat2__numRows <> 0) AND (NOT rsAuditorInfo.EOF))
%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;34&quot;><font size=&quot;2&quot;><%=(rsAuditorInfo.Fields.Item(&quot;auditor&quot;).Value)%>&nbsp;</font></td>
<td><font size=&quot;2&quot;>&nbsp;<%=(rsAuditorInfo.Fields.Item(&quot;SumOfnumAudited&quot;).Value)%></font></td>
<td><font size=&quot;2&quot;><%=(rsAuditorInfo.Fields.Item(&quot;SumOfnumOrdErr&quot;).Value)%>&nbsp;</font></td>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rsAuditorInfo.MoveNext()
Wend
%>
</table>
<table width=&quot;784&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;419&quot; height=&quot;23&quot; valign=&quot;top&quot;> <% If rsAuditorInfo.EOF And rsAuditorInfo.BOF Then %>
No Records to Display for that day, please try again
<% End If ' end rsAuditorInfo.EOF And rsAuditorInfo.BOF %> </td>
<td width=&quot;349&quot;>&nbsp;</td>
</tr>
</table>
<table width=&quot;405&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#006699&quot;>
<!--DWLayoutTable-->
<% If Not rsErrorRate.EOF Or Not rsErrorRate.BOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;124&quot; height=&quot;28&quot;>
<div align=&quot;center&quot;>Date</div></td>
<td width=&quot;155&quot;>
<div align=&quot;center&quot;>Error Rate</div></td>
<td width=&quot;94&quot; valign=&quot;top&quot;>#
of Audits</td>
</tr>
<% End If ' end Not rsErrorRate.EOF Or NOT rsErrorRate.BOF %>
<%
While ((Repeat4__numRows <> 0) AND (NOT rsErrorRate.EOF))
%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;34&quot;><div align=&quot;center&quot;><font size=&quot;2&quot;><%=(rsErrorRate.Fields.Item(&quot;auditDateByDay&quot;).Value)%></font></div></td>
<td><div align=&quot;center&quot;><font size=&quot;2&quot;><%=(rsErrorRate.Fields.Item(&quot;ErrorRate&quot;).Value)%>%&nbsp;</font></div></td>
<td valign=&quot;top&quot;><font size=&quot;2&quot;>&nbsp;</font></td>
</tr>
<%
Repeat4__index=Repeat4__index+1
Repeat4__numRows=Repeat4__numRows-1
rsErrorRate.MoveNext()
Wend
%>
</table>
<table width=&quot;421&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;4&quot; height=&quot;31&quot;>&nbsp;</td>
<td colspan=&quot;3&quot; valign=&quot;top&quot;> <% If rsErrorRate.EOF And rsErrorRate.BOF Then %>
No Records to Display for that day, please try again
<% End If ' end rsErrorRate.EOF And rsErrorRate.BOF %> </td>
</tr>
<tr>
<td height=&quot;19&quot;>&nbsp;</td>
<td width=&quot;88&quot;>&nbsp;</td>
<td width=&quot;142&quot;>&nbsp;</td>
<td width=&quot;187&quot;>&nbsp;</td>
</tr>
<tr>
<td height=&quot;21&quot; colspan=&quot;3&quot; valign=&quot;top&quot;><hr color=&quot;#006699&quot;></td>
<td></td>
</tr>
<tr>
<td height=&quot;24&quot; colspan=&quot;2&quot; valign=&quot;top&quot;><form name=&quot;form2&quot; method=&quot;post&quot; action=&quot;audits.asp&quot;>
<input name=&quot;newAudit&quot; type=&quot;submit&quot; id=&quot;newAudit&quot; value=&quot;New Audit&quot;>
</form></td>
<td valign=&quot;top&quot;><form name=&quot;form3&quot; method=&quot;post&quot; action=&quot;auditStats.asp&quot;>
<input name=&quot;viewStats&quot; type=&quot;submit&quot; id=&quot;viewStats&quot; value=&quot;View Stats&quot;>
</form></td>
<td></td>
</tr>
</table>
</body>
</html>
<%
rsAuditInfo.Close()
Set rsAuditInfo = Nothing
%>


PLEASE HELP!
 
Should work ok unless I made a typo or two. Hopefully none of the fields in the database have changed since your original post otherwise it's gonna blow up.

AuditStats.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;time_nav_js.txt&quot;-->
<html>
<head>
<title>Audit Statistics</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;return_style.css&quot;>

</head>
<body>
<h1>Audit Statistics</h1>
<!--#include file=&quot;time_nav.txt&quot;-->
<h4>Enter A Date Below (examples: 7/14/2003, 7/14)</h4>
<form name=&quot;frmDates&quot; method=&quot;post&quot; action=&quot;take_auditStats.asp&quot;>
<p>
<input name=&quot;beginDate&quot; type=&quot;text&quot; id=&quot;date1&quot; value=&quot;<%= date() %>&quot; size=&quot;12&quot;>
And
<input name=&quot;endDate&quot; type=&quot;text&quot; id=&quot;date2&quot; value=&quot;<%= date() %>&quot; size=&quot;12&quot;>
<input type=&quot;submit&quot; name=&quot;btnSubmit&quot; value=&quot;Submit&quot; onClick=&quot;Validate()&quot;>
</p>
<script language=&quot;VBScript&quot;>
Sub Validate()
if len(frmDates.beginDate.value)=0 or frmDates.beginDate.value=&quot;&quot; then
alert &quot;Please enter a starting date&quot;
window.event.returnvalue=false
frmDates.beginDate.focus
exit sub
End if
if not isdate(frmDates.beginDate.value) then
alert &quot;Please enter a valid start date&quot;
window.event.returnvalue=false
frmDates.beginDate.focus
exit sub
End if
if len(frmDates.endDate.value)=0 or frmDates.endDate.value=&quot;&quot; then
alert &quot;Please enter an ending date&quot;
window.event.returnvalue=false
frmDates.endDate.focus
exit sub
End if
if not isdate(frmDates.endDate.value) then
alert &quot;Please enter a valid end date&quot;
window.event.returnvalue=false
frmDates.endDate.focus
exit sub
End if
End Sub
</script>
</form>
<hr>
</body>
</html>

====================================================
take_AuditStats.asp

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/admin.asp&quot; -->
<%
beginDate = Request.Form(&quot;beginDate&quot;)
endDate = Request.Form(&quot;endDate&quot;)
%>
<%
Set conn=server.CreateObject(&quot;ADODB.CONNECTION&quot;)
conn.open MM_admin_STRING
strSQL=&quot;SELECT * FROM tblAudits WHERE auditDate BETWEEN #&quot; & beginDate & &quot;# AND #&quot; & endDate & &quot;# ORDER BY auditDate&quot;
set rsAuditInfo=conn.execute(strSQL)

strSQL=&quot;SELECT * FROM qAuditorInfo WHERE auditDateByDay BETWEEN #&quot; & beginDate & &quot;# AND #&quot; & endDate & &quot;# ORDER BY auditDateByDay&quot;
set rsAuditorInfo=conn.execute(strSql)

strSQL=&quot;SELECT * FROM qErrorRate WHERE auditDateByDay BETWEEN #&quot; & beginDate & &quot;# AND #&quot; & endDate & &quot;# ORDER BY auditDateByDay&quot;
set rsErrorRate=conn.execute(strSql)
%>
<html>
<head>
<title>Audit Statistics</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charsAuditoret=iso-8859-1&quot;>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;return_style.css&quot;>
</head>
<body>
<h1>Audit Statistics</h1>
<!--#include file=&quot;time_nav.txt&quot;-->
<table width=&quot;740&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;740&quot; height=&quot;23&quot; valign=&quot;top&quot;><hr color=&quot;#006699&quot;> </td>
</tr>
</table>
<table width=&quot;385&quot; border=&quot;1&quot; bordercolor=&quot;#006699&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<% If Not rsAuditInfo.EOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;40&quot; height=&quot;46&quot;>
<div align=&quot;center&quot;>Letter</div></td>
<td width=&quot;50&quot;>
<div align=&quot;center&quot;>Auditor</div></td>
<td width=&quot;79&quot;>
<div align=&quot;center&quot;># Of Orders</div></td>
<td width=&quot;86&quot;>
<div align=&quot;center&quot;># Of Errors</div></td>
<td width=&quot;77&quot;>
<div align=&quot;center&quot;>Complete?</div></td>
</tr>
<% do while not rsAuditInfo.eof
Letter=rsAuditInfo(&quot;Letter&quot;)
Auditor=rsAuditInfo(&quot;auditor&quot;)
NumAudited=rsAuditInfo(&quot;numAudited&quot;)
NumOrdErr=rsAuditInfo(&quot;numOrdErr&quot;)
OrderComp=rsAuditInfo(&quot;orderComp&quot;)%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;28&quot;><font size=&quot;2&quot;><%=Letter%> </font></td>
<td><font size=&quot;2&quot;><%=Auditor%> </font></td>
<td><font size=&quot;2&quot;><%=NumAudited%> </font></td>
<td><font size=&quot;2&quot;> <%=NumOrdErr%></font></td>
<td valign=&quot;top&quot;><font size=&quot;2&quot;><%=OrderComp%></font></td>
</tr>
<%
rsAuditInfo.MoveNext()
loop%>
</table>
<%ELSE%>
<table width=&quot;740&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;387&quot; height=&quot;21&quot; valign=&quot;top&quot;>
No Records to Display for that day, please try again </td>
<td width=&quot;353&quot;></td>
</tr>
<tr>
<td height=&quot;2&quot;></td>
<td></td>
</tr>
</table>
<% END IF
set rsAuditInfo=nothing%>

<table width=&quot;353&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#006699&quot;>
<!--DWLayoutTable-->
<% If Not rsAuditorInfo.EOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;123&quot; height=&quot;54&quot;><div align=&quot;center&quot;>Auditor</div></td>
<td width=&quot;74&quot; align=&quot;center&quot; valign=&quot;middle&quot;>
<div align=&quot;center&quot;># Of Orders Audited</div></td>
<td width=&quot;124&quot; align=&quot;center&quot; valign=&quot;middle&quot;>
<div align=&quot;center&quot;># Of Errors Found</div></td>
</tr>

<% do while not rsAuditorInfo.EOF
Auditor=rsAuditorInfo(&quot;Auditor&quot;)
OrdersAudited=rsAuditorInfo(&quot;SumOfNumAudited&quot;)
ErrorsFound=rsAuditorInfo(&quot;SumOfOrdErr&quot;)
%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;34&quot;><font size=&quot;2&quot;><%=Auditor%> </font></td>
<td><font size=&quot;2&quot;> <%=OrdersAudited%></font></td>
<td><font size=&quot;2&quot;><%=ErrorsFound%> </font></td>
</tr>
<%
rsAuditorInfo.MoveNext()
loop%>
</table>
<%ELSE%>
<table width=&quot;784&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;419&quot; height=&quot;23&quot; valign=&quot;top&quot;>
No Records to Display for that day, please try again
</td>
<td width=&quot;349&quot;> </td>
</tr>
</table>
<%END IF
set rsAuditorInfo=nothing%>
<table width=&quot;405&quot; border=&quot;1&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#006699&quot;>
<!--DWLayoutTable-->
<% If Not rsErrorRate.EOF Then %>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td width=&quot;124&quot; height=&quot;28&quot;>
<div align=&quot;center&quot;>Date</div></td>
<td width=&quot;155&quot;>
<div align=&quot;center&quot;>Error Rate</div></td>
<td width=&quot;94&quot; valign=&quot;top&quot;>#
of Audits</td>
</tr>

<% do while not rsErrorRate.EOF
dtmDate=rsErrorRate(&quot;auditDateByDay&quot;)
ErrorRate=rsErrorRate(&quot;ErrorRate&quot;)
'NumberOfAudits=rsErrorRate(&quot;numOfAudits&quot;) ???
' I can't be sure that # of Audits is in the query so I'll leave it out%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<td height=&quot;34&quot;><div align=&quot;center&quot;><font size=&quot;2&quot;><%=dtmDate%></font></div></td>
<td><div align=&quot;center&quot;><font size=&quot;2&quot;><%=ErrorRate%>% </font></div></td>
<td valign=&quot;top&quot;><font size=&quot;2&quot;> </font></td>
</tr>
<%rsErrorRate.MoveNext()
Loop%>
</table>
<%ELSE%>
<table width=&quot;421&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<!--DWLayoutTable-->
<tr>
<td width=&quot;4&quot; height=&quot;31&quot;> </td>
<td colspan=&quot;3&quot; valign=&quot;top&quot;>
No Records to Display for that day, please try again
</td>
</tr>
<tr>
<td height=&quot;19&quot;> </td>
<td width=&quot;88&quot;> </td>
<td width=&quot;142&quot;> </td>
<td width=&quot;187&quot;> </td>
</tr>
<%END IF
set rsErrorRate=nothing
conn.close
set conn=nothing%>
<tr>
<td height=&quot;21&quot; colspan=&quot;3&quot; valign=&quot;top&quot;><hr color=&quot;#006699&quot;></td>
<td></td>
</tr>
<tr>
<td height=&quot;24&quot; colspan=&quot;2&quot; valign=&quot;top&quot;><form name=&quot;form2&quot; method=&quot;post&quot; action=&quot;audits.asp&quot;>
<input name=&quot;newAudit&quot; type=&quot;submit&quot; id=&quot;newAudit&quot; value=&quot;New Audit&quot;>
</form></td>
<td valign=&quot;top&quot;><form name=&quot;form3&quot; method=&quot;post&quot; action=&quot;auditStats.asp&quot;>
<input name=&quot;viewStats&quot; type=&quot;submit&quot; id=&quot;viewStats&quot; value=&quot;View Stats&quot;>
</form></td>
<td></td>
</tr>
</table>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top