Can someone help me with this please. I am trying to add totals from a category, but yet it wont work properly. I have tried several ways to make it work and every time I get errors.
What I have now is this, in one version:
Category Moves 20
Category Moves 20
Category Lab 50
Category Lab 50
What I would like is this:
Category Moves 40
Category Lab 100
I have 2 codes for it. One of them gives me the information above, the first output and the other gives me "Error Type:
(0x80020009)
Exception occurred.
/Reports/Daily/Reports/UserReport.asp, line 212"
Can someone please HELP me with this? Been working on it for 3 days and still no luck.
SQL Query:
<%
UserID = TRIM( Request.QueryString( "UserID" )
WkID = TRIM( Request.QueryString( "WkID" )
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT Main.Site, Main.Technician, Main.TSpent, Main.Category, Main.Date1, Main.Department, Main.DeptWork, Main.Week, Department.Department as Department_Name, Technicians.Technician as Tech_Name, Category.Category as Category_Name "
SqlString = SqlString & " FROM ((((Main INNER JOIN Technicians ON Main.Technician = Technicians.TechID) INNER JOIN Site ON Main.Site = Site.SiteID) INNER JOIN Department ON Main.Department = Department.DeptID) INNER JOIN Category ON Main.Category = Category.CatID) INNER JOIN Week ON Main.Week = Week.WeekID"
SqlString = SqlString & " WHERE Technicians.TechID = " & UserID & " and Week.WeekID = " & WkID
SqlString = SqlString & " Order by Main.Category "
SET RS = objConn.Execute( sqlString )
%>
Table Code:
<td width="287" bgcolor="<%=bgColor%>"><div align="right"><em><font color="#000000" size="2">
<%While Not RS.EOF
CatName = RS("Category"
Response.Write(Category)
Spent = 0
Total = 0
While CatName = CatName
Total = Total + RS("TSpent"
RS.MoveNext
Wend
%> Hr(s)</font></em></div></td>
</tr>
<% Wend
%>
Line 212 is ====Total = Total + RS("TSpent"====
Any help on this I would REALLY appreciate it. Bascially just want the total time spent on each category, but output it just ones with the total instead of # of the category records it exists. Thank Again for your HELP.
What I have now is this, in one version:
Category Moves 20
Category Moves 20
Category Lab 50
Category Lab 50
What I would like is this:
Category Moves 40
Category Lab 100
I have 2 codes for it. One of them gives me the information above, the first output and the other gives me "Error Type:
(0x80020009)
Exception occurred.
/Reports/Daily/Reports/UserReport.asp, line 212"
Can someone please HELP me with this? Been working on it for 3 days and still no luck.
SQL Query:
<%
UserID = TRIM( Request.QueryString( "UserID" )
WkID = TRIM( Request.QueryString( "WkID" )
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT Main.Site, Main.Technician, Main.TSpent, Main.Category, Main.Date1, Main.Department, Main.DeptWork, Main.Week, Department.Department as Department_Name, Technicians.Technician as Tech_Name, Category.Category as Category_Name "
SqlString = SqlString & " FROM ((((Main INNER JOIN Technicians ON Main.Technician = Technicians.TechID) INNER JOIN Site ON Main.Site = Site.SiteID) INNER JOIN Department ON Main.Department = Department.DeptID) INNER JOIN Category ON Main.Category = Category.CatID) INNER JOIN Week ON Main.Week = Week.WeekID"
SqlString = SqlString & " WHERE Technicians.TechID = " & UserID & " and Week.WeekID = " & WkID
SqlString = SqlString & " Order by Main.Category "
SET RS = objConn.Execute( sqlString )
%>
Table Code:
<td width="287" bgcolor="<%=bgColor%>"><div align="right"><em><font color="#000000" size="2">
<%While Not RS.EOF
CatName = RS("Category"
Response.Write(Category)
Spent = 0
Total = 0
While CatName = CatName
Total = Total + RS("TSpent"
RS.MoveNext
Wend
%> Hr(s)</font></em></div></td>
</tr>
<% Wend
%>
Line 212 is ====Total = Total + RS("TSpent"====
Any help on this I would REALLY appreciate it. Bascially just want the total time spent on each category, but output it just ones with the total instead of # of the category records it exists. Thank Again for your HELP.