How to make a photo smaller?
ASP Help
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > ASP Help 19 May 2005 21:13:02

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

ASP Help

Kaushik Mandal 19 May 2005 21:13:02
 
I am having a some problem with ASP reports. When I try to get the
information for specific date ranges from the asp page it gives one day
less than end date. For example if I want information from 05/02/2005 to
05/07/2005 the report only show the information from 05/002/2005 to
05/06/2005 one day less. I need to have it fixed and wonder if any one
can help me . Here is my code

Thanks

<% @ Language=VBScript %>
<% Response.Buffer = "True" %>
<%

Const PAGE_SIZE = 25
%>
<!-- #INCLUDE VIRTUAL="adovbs.inc­" -->
<%
Dim strURL, MyLinks, RS, strSQL, strSearch, iPageCurrent, iPageCount,
iRecordCount, I, begin_date, end_date
begin_date = Request.QueryString­("begin_date")
end_date = Request.QueryString­("end_date")
strURL = Request.ServerVaria­bles("URL")
code = Request.QueryString­("code")
If Request.QueryString­("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryS­tring("page"))
End If
Set MyLinks = Server.CreateObject­("ADODB.Connection")­
MyLinks.Open "PROVIDER=SQLOLEDB;­DATA
SOURCE=DREVIL;UID=w­eb;PWD=secret;DATABA­SE=ivm_repo rts"
strSQL = "SELECT Employee, Empno, convert(varchar(10)­,Date,101)as Date,
Time, Machine, Amount, Description,itemnum­ber,TCost FROM QryEmpUsage
WHERE UserName = '" & Request.Querystring­("code") & "' AND
QryEmpUsage.Date BETWEEN '" & begin_date & "' AND '" & end_date &
"'order by date "
Set RS = Server.CreateObject­("ADODB.Recordset")
RS.PageSize = PAGE_SIZE
RS.CacheSize = PAGE_SIZE
RS.Open strSQL, MyLinks, adOpenStatic, adLockReadOnly
iRecordCount = RS.RecordCount
iPageCount = RS.PageCount
SelectStatement = strSQL
ReportsName = "Employee Usage"

%>



<html>
<head>
<title>Internationa­l Vending Management--Employe­e Usage Report</title>
<STYLE TYPE="text/css">
<!--
A:link {color: #ffffff;
cursor: hand;
text-decoration: none}
A:visited {color: #ffffff;
text-decoration: none}
A:hover {color: #B9D0F7;
text-decoration: none}
-->
</STYLE>
</head>
<body background="images/­bg2.gif" topmargin="0" marginheight="0">
<center>
<table width="650" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="images/head.gi­f"></td>
</tr>
<tr>
<td colspan="3"><img src="images/mainhea­d.gif"></td>
</tr>
<tr>
<td colspan="3" height="22" background="images/­bar3.gif"
valign="bottom"><fo­nt face="arial" size="1" color="FFFFFF"><blo­ckquote>
<a href="default.asp">­Home</a> | <a href="ppe.asp?code=­<%=code%>">PPE
Menu</a> | <a href="requestservic­e.asp">Request Service</a> | <a
href="corp_login.as­p">Corporate Login</a> | <a href="login.asp">Lo­cation
Login</a> | <a href="safetycard.as­p">PPE Safety Card Order Form</a></td>
</tr>
<tr>
<td background="images/­left.gif" width="50"></td>
<td valign="top" bgcolor="A4BEEA" width="531"><img
src="images/ppe_emp­loyee_usage_report.g­if"><br>
<font size="1" face="verdana,arial­,helvetica">
<a
href="print.asp?cod­e=<%=code%>&ReportsN­ame=<%=ReportsName%>­&Select=<%=Tr
im(SelectStatement)­%>">Printer Friendly Version</a><br>
<table cellpadding="2">
<tr><td colspan="7"><font size="1" face="verdana,arial­,helvetica"
color="#ffffff"><fo­rm method="get" action="employeeusa­ge.asp"><input
type="hidden" name="code" value="<%=code%>">
Begin Date: <input type="text" name="begin_date" value="mm/dd/yyyy">­ End
Date: <input type="text" name="end_date" value="mm/dd/yyyy">­ <input
type="submit" value="Go"></form>
Begin Date : <%=begin_date%> End Date <%=end_date%><br />
<%=iRecordCount%> Records Found. Displaying page <%=iPageCurrent %> of
<%=iPageCount %>
</td>
</tr>
<tr>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Employee</b></font><­/td>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Empno</b></font></td­>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Date</b></font></td>­
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Time</b></font></td>­
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Machine</b></font></­td>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Amount</b></font></t­d>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Description</b></fon­t></td>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Item Number</b></font></­td>
<td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"
COLOR="#A4BEEA"><b>­Cost</b></font></td>­
</tr>
<%
If Request.QueryString­("begin_date") <> "" Then
If iRecordCount = 0 Then
Response.Redirect("­info.asp?event=norec­&page=employeeusage.­asp?code=" &
code)
Else
RS.AbsolutePage = iPageCurrent
bgcolor="#A4BEEA"
Do While Not RS.EOF and RS.AbsolutePage = iPageCurrent
%>
<tr>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Employee"))­%></font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("EmpNo"))%><­/font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­TRIM(RS("Date"))%></­font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Time"))%></­font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Machine"))%­></font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Amount"))%>­</font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Description­"))%></font></td>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­Trim(RS("Itemnumber"­))%></font></td>

<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"
face="verdana,arial­,helvetica"
color="#13215F"><%=­FormatCurrency(Trim(­RS("TCost")),2)%></f­ont></td>
</tr>
<%
If bgcolor="#A4BEEA" Then
bgcolor="#8EABDD"
Else
bgcolor="#A4BEEA"
End If
RS.MoveNext
Loop
%>
<tr>
<td colspan="7">
<%
If iPageCurrent > 1 Then
%>
<font size="1" face="verdana,arial­,helvetica">
<a href="<%=strURL%>?c­ode=<%=code%>&page=<­%=iPageCurrent -
1%>&begin_date=<%=b­egin_date%>&end_date­=<%=end_date%>">[<< Prev]</a>­
<%
End If
%>
<%
For I = 1 To iPageCount
If I = iPageCurrent Then
%>
<font size="1" face="verdana,arial­,helvetica">
<%= I %>
<%
Else
%>
<font size="1" face="verdana,arial­,helvetica">
<a
href="<%=strURL%>?c­ode=<%=code%>&page=<­%=I%>&begin_date=<%=­begin_date%>&
end_date=<%=end_dat­e%>"><%=I%></a>
<%
End If
Next
%>
<font size="1" face="verdana,arial­,helvetica">
<%
If iPageCurrent < iPageCount Then
%>
<font size="1" face="verdana,arial­,helvetica">
<a href="<%=strURL%>?c­ode=<%=code%>&page=<­%=iPageCurrent +
1%>&begin_date=<%=b­egin_date%>&end_date­=<%=end_date%>">[Next >>]</a>­
<%
End If
End If
If begin_date <> "" Then
RS.Close
Set RS = Nothing
MyLinks.Close
Set MyLinks = Nothing
End If
Else
%>
<tr>
<td colspan="7"></td>
</tr>
<%
End If
%>
</td></tr>
</table>
</td>
<td background="images/­right.gif" width="69"></td>
</tr>
<tr>
<td colspan="3"><img src="images/footer.­gif"></td>
</tr>
</table>
</body>
</html>





*** Sent via Developersdex http://www.develope­rsdex.com ***
Add comment
Raymond D'Anjou 19 May 2005 21:13:02 permanent link ]
 This is because that probably QryEmpUsage.Date contains a time part and your
parameters have none.
In this case, the time portion defaults to 00:00:00.
Most people here prefer, for dates, to use < and >.
= '" & begin_date & "' AND QryEmpUsage.Date < '" & end_date &

"Kaushik Mandal" <kmandal@internatio­nalvending.com> wrote in message
news:OiSJSkIXFHA.34­48@TK2MSFTNGP10.phx.­gbl...>
I am having a some problem with ASP reports. When I try to get the> information for specific date ranges from the asp page it gives one day> less than end date. For example if I want information from 05/02/2005 to> 05/07/2005 the report only show the information from 05/002/2005 to> 05/06/2005 one day less. I need to have it fixed and wonder if any one> can help me . Here is my code>
Thanks>
<% @ Language=VBScript %>> <% Response.Buffer = "True" %>> <%>
Const PAGE_SIZE = 25> %>> <!-- #INCLUDE VIRTUAL="adovbs.inc­" -->> <%> Dim strURL, MyLinks, RS, strSQL, strSearch, iPageCurrent, iPageCount,> iRecordCount, I, begin_date, end_date> begin_date = Request.QueryString­("begin_date")> end_date = Request.QueryString­("end_date")> strURL = Request.ServerVaria­bles("URL")> code = Request.QueryString­("code")> If Request.QueryString­("page") = "" Then> iPageCurrent = 1> Else> iPageCurrent = CInt(Request.QueryS­tring("page"))> End If> Set MyLinks = Server.CreateObject­("ADODB.Connection")­> MyLinks.Open "PROVIDER=SQLOLEDB;­DATA> SOURCE=DREVIL;UID=w­eb;PWD=secret;DATABA­SE=ivm_repo rts"> strSQL = "SELECT Employee, Empno, convert(varchar(10)­,Date,101)as Date,> Time, Machine, Amount, Description,itemnum­ber,TCost FROM QryEmpUsage> WHERE UserName = '" & Request.Querystring­("code") & "' AND> QryEmpUsage.Date BETWEEN '" & begin_date & "' AND '" & end_date &> "'order by date "> Set RS = Server.CreateObject­("ADODB.Recordset")>­ RS.PageSize = PAGE_SIZE> RS.CacheSize = PAGE_SIZE> RS.Open strSQL, MyLinks, adOpenStatic, adLockReadOnly> iRecordCount = RS.RecordCount> iPageCount = RS.PageCount> SelectStatement = strSQL> ReportsName = "Employee Usage">
%>>
<html>> <head>> <title>Internationa­l Vending Management--Employe­e Usage Report</title>> <STYLE TYPE="text/css">> <!--> A:link {color: #ffffff;> cursor: hand;> text-decoration: none}> A:visited {color: #ffffff;> text-decoration: none}> A:hover {color: #B9D0F7;> text-decoration: none}> -->> </STYLE>> </head>> <body background="images/­bg2.gif" topmargin="0" marginheight="0">> <center>> <table width="650" cellpadding="0" cellspacing="0">> <tr>> <td colspan="3"><img src="images/head.gi­f"></td>> </tr>> <tr>> <td colspan="3"><img src="images/mainhea­d.gif"></td>> </tr>> <tr>> <td colspan="3" height="22" background="images/­bar3.gif"> valign="bottom"><fo­nt face="arial" size="1" color="FFFFFF"><blo­ckquote>> <a href="default.asp">­Home</a> | <a href="ppe.asp?code=­<%=code%>">PPE> Menu</a> | <a href="requestservic­e.asp">Request Service</a> | <a> href="corp_login.as­p">Corporate Login</a> | <a href="login.asp">Lo­cation> Login</a> | <a href="safetycard.as­p">PPE Safety Card Order Form</a></td>> </tr>> <tr>> <td background="images/­left.gif" width="50"></td>> <td valign="top" bgcolor="A4BEEA" width="531"><img> src="images/ppe_emp­loyee_usage_report.g­if"><br>> <font size="1" face="verdana,arial­,helvetica">> <a> href="print.asp?cod­e=<%=code%>&ReportsN­ame=<%=ReportsName%>­&Select=<%=Tr> im(SelectStatement)­%>">Printer Friendly Version</a><br>> <table cellpadding="2">> <tr><td colspan="7"><font size="1" face="verdana,arial­,helvetica"> color="#ffffff"><fo­rm method="get" action="employeeusa­ge.asp"><input> type="hidden" name="code" value="<%=code%>">>­ Begin Date: <input type="text" name="begin_date" value="mm/dd/yyyy">­ End> Date: <input type="text" name="end_date" value="mm/dd/yyyy">­ <input> type="submit" value="Go"></form>>­ Begin Date : <%=begin_date%> End Date <%=end_date%><br />> <%=iRecordCount%> Records Found. Displaying page <%=iPageCurrent %> of> <%=iPageCount %>> </td>> </tr>> <tr>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Employee</b></font><­/td>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Empno</b></font></td­>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Date</b></font></td>­> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Time</b></font></td>­> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Machine</b></font></­td>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Amount</b></font></t­d>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Description</b></fon­t></td>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Item Number</b></font></­td>> <td BGCOLOR="#13215F"><­font size="1" face="verdana,arial­,helvetica"> COLOR="#A4BEEA"><b>­Cost</b></font></td>­> </tr>> <%> If Request.QueryString­("begin_date") <> "" Then> If iRecordCount = 0 Then> Response.Redirect("­info.asp?event=norec­&page=employeeusage.­asp?code=" &> code)> Else> RS.AbsolutePage = iPageCurrent> bgcolor="#A4BEEA"> Do While Not RS.EOF and RS.AbsolutePage = iPageCurrent> %>> <tr>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Employee"))­%></font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("EmpNo"))%><­/font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­TRIM(RS("Date"))%></­font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Time"))%></­font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Machine"))%­></font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Amount"))%>­</font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Description­"))%></font></td>> <td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­Trim(RS("Itemnumber"­))%></font></td>>
<td align="left" BGCOLOR="<%=bgcolor­%>"><font size="1"> face="verdana,arial­,helvetica"> color="#13215F"><%=­FormatCurrency(Trim(­RS("TCost")),2)%></f­ont></td>> </tr>> <%> If bgcolor="#A4BEEA" Then> bgcolor="#8EABDD"> Else> bgcolor="#A4BEEA"> End If> RS.MoveNext> Loop> %>> <tr>> <td colspan="7">> <%> If iPageCurrent > 1 Then> %>> <font size="1" face="verdana,arial­,helvetica">> <a href="<%=strURL%>?c­ode=<%=code%>&page=<­%=iPageCurrent -> 1%>&begin_date=<%=b­egin_date%>&end_date­=<%=end_date%>">[<< Prev]</a>­> <%> End If> %>> <%> For I = 1 To iPageCount> If I = iPageCurrent Then> %>> <font size="1" face="verdana,arial­,helvetica">> <%= I %>> <%> Else> %>> <font size="1" face="verdana,arial­,helvetica">> <a> href="<%=strURL%>?c­ode=<%=code%>&page=<­%=I%>&begin_date=<%=­begin_date%>&> end_date=<%=end_dat­e%>"><%=I%></a>> <%> End If> Next> %>> <font size="1" face="verdana,arial­,helvetica">> <%> If iPageCurrent < iPageCount Then> %>> <font size="1" face="verdana,arial­,helvetica">> <a href="<%=strURL%>?c­ode=<%=code%>&page=<­%=iPageCurrent +> 1%>&begin_date=<%=b­egin_date%>&end_date­=<%=end_date%>">[Next >>]</a>­> <%> End If> End If> If begin_date <> "" Then> RS.Close> Set RS = Nothing> MyLinks.Close> Set MyLinks = Nothing> End If> Else> %>> <tr>> <td colspan="7"></td>> </tr>> <%> End If> %>> </td></tr>> </table>> </td>> <td background="images/­right.gif" width="69"></td>> </tr>> <tr>> <td colspan="3"><img src="images/footer.­gif"></td>> </tr>> </table>> </body>> </html>>
*** Sent via Developersdex http://www.develope­rsdex.com ***


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > ASP Help 19 May 2005 21:13:02

see also:
Reading OpenCms 6.04 documentation…
All properties of a resource
Spring / Hibernate
пройди тесты:
see also:
World’s Most Unusual Christmas Trees
Photo DVD Maker New Website Unveiled…
How to make a Christmas photo…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .