Unsure about using COUNT (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Kinux -> Unsure about using COUNT (11/22/2004 16:47:16)

I'm not sure if I'm using COUNT right. When I use this code the page show's lots of blank cells.
What I'd like to do is have the page display the "status" totals for each responder.

i.e.

Joe Smith 10 Completed 5 Pending 2 Received

I know this code doesn't get me there all the way but I will tweak it as I figure more out.
Could anyone give me some suggestions or point me in the right direction.


<!--#include file="../../../../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT Responder,COUNT(status) AS worktotal FROM WORKORDERS WHERE status in ('Completed','Pending','Received')GROUP BY Responder"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=16 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="workorders"
fp_iMaxRecords=2048
fp_iCommandType=1
fp_iPageSize=10
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes=""
fp_iDisplayCols=16
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../../_fpclass/fpdbrgn1.inc"-->

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WORKORDERS-- List</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<base target="_self">
</head>

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">


<table border="1" width="100%">
	<tr>
		<td> </td>
		<td><%=worktotal%></td>
		<td> </td>
	</tr>
</table>


<!--#include file="../../../../_fpclass/fpdbrgn2.inc"-->

</body>

</html>




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625