Wild@Heart
03-08-2006, 02:36 AM
Hi everyone,
I really hope someone can help me. I've searched the web death but cannot get the answer to this. I'm very very very new to any programming, I'm learning myself by reading code and seeing what it does ... so please be kind to me with the technical terms
I've got a database with entries by agent for every day. Each agent is linked to a manager.
In other words it would look something like this
Agent Date Manager Value
Agent A 03/01/2006 Man_A 1
Agent A 04/01/2006 Man_A 1
Agent B 03/01/2006 Man_A 1
What I would like to do is to consolidate the date value for Man_A
So the output should look like this
Date Value
03/01/2006 2
04/01/2006 1
I've tried all the code but it does not work:
Here is the code I've been using -
=====================================================
strSQLReport = "SELECT MAX(Date) as Rs_Date, SUM(Present) as Rs_Present ,SUM(Actual_Hours) as rs_hours ,SUM(Actual_Minutes) as rs_minutes FROM tblIncentivedata WHERE Manager_Empl_Nr = '"& Request.Form("Agent") &"' AND (Date BETWEEN #"&DateStart&"# AND #"& DateEnd &"#)"
rsReport.Open strSQLReport, adoConReport
Rs_Date = rsReport("Rs_Date")
Rs_Present = rsReport("RS_Present")
TotalHours = rsReport("rs_hours")
TotalMinutes = rsReport("rs_minutes")
If rsReport.EOF then
response.write("No Records Found")
End If
Do until rsReport.EOF
Response.Write("<tr align='center'>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(rs_Date)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(Rs_Present)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(TotalHours)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(TotalMInutes)
response.write("</td>")
Response.Write("</tr>")
rsReport.MoveNext
Loop
=====================================================
I really hope you can help me ...
If you need any info I'll gladly provide what I can ...
I really hope someone can help me. I've searched the web death but cannot get the answer to this. I'm very very very new to any programming, I'm learning myself by reading code and seeing what it does ... so please be kind to me with the technical terms
I've got a database with entries by agent for every day. Each agent is linked to a manager.
In other words it would look something like this
Agent Date Manager Value
Agent A 03/01/2006 Man_A 1
Agent A 04/01/2006 Man_A 1
Agent B 03/01/2006 Man_A 1
What I would like to do is to consolidate the date value for Man_A
So the output should look like this
Date Value
03/01/2006 2
04/01/2006 1
I've tried all the code but it does not work:
Here is the code I've been using -
=====================================================
strSQLReport = "SELECT MAX(Date) as Rs_Date, SUM(Present) as Rs_Present ,SUM(Actual_Hours) as rs_hours ,SUM(Actual_Minutes) as rs_minutes FROM tblIncentivedata WHERE Manager_Empl_Nr = '"& Request.Form("Agent") &"' AND (Date BETWEEN #"&DateStart&"# AND #"& DateEnd &"#)"
rsReport.Open strSQLReport, adoConReport
Rs_Date = rsReport("Rs_Date")
Rs_Present = rsReport("RS_Present")
TotalHours = rsReport("rs_hours")
TotalMinutes = rsReport("rs_minutes")
If rsReport.EOF then
response.write("No Records Found")
End If
Do until rsReport.EOF
Response.Write("<tr align='center'>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(rs_Date)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(Rs_Present)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(TotalHours)
response.write("</td>")
Response.Write("<td class='table_white_vsmall_blue'>")
response.write(TotalMInutes)
response.write("</td>")
Response.Write("</tr>")
rsReport.MoveNext
Loop
=====================================================
I really hope you can help me ...
If you need any info I'll gladly provide what I can ...