Hello,
I have some code commented out in order to make this work. However, I would prefer to use the commented code so my users can SORT on the column heading because I know they are going to want to do that.
I appreciate any help that you can give me.
Thanks, Kris
-----------------------------------------------------
<html>
<body>
<a href="reports.h tml">Custom Reports</a>
<h1>Items: Non-Fiction</h1>
<script>
function choose(id){
// this selects the radio button that goes with the text link
document.getEle mentById(id).ch ecked=true;
}
function enable(){
document.getEle mentById().disa bled=false;
}
</script>
<%orgcodeid=req uest.form("orgc odeid")%>
<%collectionid= request.form("c ollectionid")%>
<%callnum=reque st.form("callnu m")%>
<form method="post">
<fieldset>
<input type="radio" name="orgcodeid " value="19" checked="checke d">None
<input type="radio" name="orgcodeid " value="3">3-Basin City
<input type="radio" name="orgcodeid " value="4">4-Benton City
<input type="radio" name="orgcodeid " value="5">5-Bookmobile
<input type="radio" name="orgcodeid " value="6">6-Connell
<input type="radio" name="orgcodeid " value="7">7-Kahlotus
<br>
<input type="radio" name="orgcodeid " value="8">8-Keewaydin
<input type="radio" name="orgcodeid " value="9">9-Kennewick
<input type="radio" name="orgcodeid " value="10">10-Merrill's
<input type="radio" name="orgcodeid " value="11">11-Othello
<input type="radio" name="orgcodeid " value="12">12-Pasco
<input type="radio" name="orgcodeid " value="13">13-Prosser
<input type="radio" name="orgcodeid " value="14">14-West Richland
</fieldset>
<p>
<fieldset>
<input type="radio" name="collectio nid" value="5" id="anf">5-Adult Non-Fiction
<p>
<input type="radio" name="callnum" value="'0%'" onclick='choose ("anf");enable( )'>001-099
<input type="radio" name="callnum" value="'1%'" onclick='choose ("anf");enable( )'>100-199
<input type="radio" name="callnum" value="'2%'" onclick='choose ("anf");enable( )'>200-299
<input type="radio" name="callnum" value="'3%'" onclick='choose ("anf");enable( )'>300-399
<input type="radio" name="callnum" value="'4%'" onclick='choose ("anf");enable( )'>400-499
<input type="radio" name="callnum" value="'5%'" onclick='choose ("anf");enable( )'>500-599
<input type="radio" name="callnum" value="'6%'" onclick='choose ("anf");enable( )'>600-699
<input type="radio" name="callnum" value="'7%'" onclick='choose ("anf");enable( )'>700-799
</fieldset>
<p>
<fieldset>
<input type="radio" name="collectio nid" value="19" id="cnf">19-Children's Non-Fiction
<p>
<input type="radio" name="callnum" value="'E 0%'" onclick='choose ("cnf");enable( )'>E 001-E 099
<input type="radio" name="callnum" value="'E 1%'" onclick='choose ("cnf");enable( )'>E 100-E 199
<input type="radio" name="callnum" value="'E 2%'" onclick='choose ("cnf");enable( )'>E 200-E 299
<input type="radio" name="callnum" value="'E 3%'" onclick='choose ("cnf");enable( )'>E 300-E 399
<input type="radio" name="callnum" value="'E 4%'" onclick='choose ("cnf");enable( )'>E 400-E 499
<input type="radio" name="callnum" value="'E 5%'" onclick='choose ("cnf");enable( )'>E 500-E 599
<input type="radio" name="callnum" value="'E 6%'" onclick='choose ("cnf");enable( )'>E 600-E 699
<input type="radio" name="callnum" value="'E 7%'" onclick='choose ("cnf");enable( )'>E 700-E 799
<p>
<input type="radio" name="callnum" value="'J 0%'" onclick='choose ("cnf");enable( )'>J 001-J 099
<input type="radio" name="callnum" value="'J 1%'" onclick='choose ("cnf");enable( )'>J 100-J 199
<input type="radio" name="callnum" value="'J 2%'" onclick='choose ("cnf");enable( )'>J 200-J 299
<input type="radio" name="callnum" value="'J 3%'" onclick='choose ("cnf");enable( )'>J 300-J 399
<input type="radio" name="callnum" value="'J 4%'" onclick='choose ("cnf");enable( )'>J 400-J 499
</fieldset>
<p>
<input type="submit" value="Show me the items">
<p>
</form>
<%
'if request.queryst ring("sort")<>" " then
' sort=request.qu erystring("sort ")
'else
' sort="ird.calln umber"
'end if
set conn=Server.Cre ateObject("ADOD B.Connection")
DSNtest="DRIVER ={SQL Server}; SERVER="
conn.Open DSNtest
set rs=Server.Creat eObject("ADODB. recordset")
sql=sql& "select cir.barcode as Barcode, ird.callnumber, "
sql=sql& "br.browset itle as Title, br.publicationy ear, "
sql=sql& "cast(datepart( m,ird.creationd ate) as nvarchar(2))+'-'+ cast(datepart(d d,ird.creationd ate)as nvarchar(2)) "
sql=sql& "+'-'+ cast(datepart(y yyy,ird.creatio ndate)as nvarchar(4)), "
sql=sql& "cir.LifetimeCi rcCount as LifeCirc, cast(datepart(m ,cir.lastcirctr ansactiondate) as nvarchar(2))+'-'+ "
sql=sql& "cast(datepart( dd,cir.lastcirc transactiondate )as nvarchar(2))+'-'+ "
sql=sql& "cast(datepart( yyyy,cir.lastci rctransactionda te)as nvarchar(4)), "
sql=sql& "ist.descriptio n, col.name "
sql=sql& "from circitemrecords cir "
sql=sql& "join itemstatuses ist on cir.itemstatusi d=ist.itemstatu sid "
sql=sql& "join itemrecorddetai ls ird on cir.itemrecordi d=ird.itemrecor did "
sql=sql& "join bibliographicre cords br on cir.associatedb ibrecordid=br.b ibliographicrec ordid "
sql=sql& "join organizations o on cir.assignedbra nchid=o.organiz ationid "
sql=sql& "join collections col on cir.assignedcol lectionid=col.c ollectionid "
sql=sql& "where o.organizationi d= '" & orgcodeid & "' "
sql=sql& "and col.collectioni d ='" & collectionid & "' "
sql=sql& "and ird.callnumber like " & callnum & " "
sql=sql& "and (ist.itemstatus id <> 7 "
sql=sql& "and ist.itemstatusi d <> 10 "
sql=sql& "and ist.itemstatusi d <> 11 "
sql=sql& "and ist.itemstatusi d <> 13 "
sql=sql& "and ist.itemstatusi d <> 14 "
sql=sql& "and ist.itemstatusi d <> 15) "
'sql=sql& "group by cir.barcode, ird.callnumber, br.browsetitle, br.publicationy ear, ird.creationdat e, cir.LifetimeCir cCount, cir.lastcirctra nsactiondate, ist.description , col.name "
'sql=sql& "order by " & sort
sql=sql& "order by ird.callnumber "
rs.Open sql,conn
str=rs.GetStrin g(,,"</td><td>","</td></tr><tr><td>","& nbsp;")
%>
<table border="1" width="100%" bgcolor="#fff5e e">
<tr>
<th align="center" bgcolor="#b0c4d e">
<%
Dim branch
whodat=Request( "orgcodeid" )
Response.Write "with OrganizationID . . . " & whodat
%>
</th>
</tr>
</table>
<table border="1" width="100%" bgcolor="#fff5e e">
<tr>
<th align="left" bgcolor="#b0c4d e">Barcode</th>
<th align="left" bgcolor="#b0c4d e">CallNumbe r</th>
<th align="left" bgcolor="#b0c4d e">Title</th>
<th align="left" bgcolor="#b0c4d e">PubYear</th>
<th align="left" bgcolor="#b0c4d e">Created</th>
<th align="left" bgcolor="#b0c4d e">Circs</th>
<th align="left" bgcolor="#b0c4d e">LastCirc</th>
<th align="left" bgcolor="#b0c4d e">In?</th>
<th align="left" bgcolor="#b0c4d e">Collectio n</th>
</tr>
<tr>
<td><%Response. Write(str)%></td>
</tr>
</table>
<%
rs.close
conn.close
set rs = Nothing
set conn = Nothing
%>
</body>
</html>