473,581 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sort by column heading not working

1 New Member
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>
Apr 30 '07 #1
0 1482

Sign in to post your reply or Sign up for a free account.

Similar topics

4
21340
by: Thomas Jerkins | last post by:
When I write a create table SQL statement I want to add some information about the column heading of each column. How does the exact syntax for the create table look like (which includes this column data look)? How do I add later column headings ? Tom
4
2436
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected represents the indes of the actual DataGrid and not the DataView. For example.. Lets say I have 4 rows of data.. In the 4 rows I have an Appt...
4
5315
by: pw | last post by:
Hi, I have month names (coming from a field in a table) as the column heading in an Access 97 crosstab query. It is being sorted alphabetically. This will not do. The only way that I know to get around it is to use month numbers instead, but I'd rather have the names appear. Any ideas?
3
4159
by: Paula | last post by:
I need to do a summary using a crosstab query. The data has a Date field (Not named "Date"). I can do the Row Heading and Value but am having trouble with the Column Heading. The summary Columns needs to read like: Sept01 to Aug02 Sept02 to Aug03 Sept03 to Aug04 Can anyone give me a recommendation on how to get from the Date...
4
2710
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all my rows back to their defaults. I populate the datagrid, resize it accordingly and it works fine...just when I click the headers is when it messes...
0
2005
by: Kaur | last post by:
Hi, I have created a report based on a cross tab query and would like to Sort the column heading of the report based on the sort order of another field. I have three tables called survey results, survey questions and survey response choices. Survey response choices has over 800 choices types. Survey results capture results of all the...
0
2154
by: Kaur | last post by:
Hi, I have created a report based on a cross tab query and would like to Sort the column heading of the report based on the sort order of another field. I have three tables called survey results, survey questions and survey response choices. Survey response choices has over 800 choices types. Survey results capture results of all the...
1
1440
by: keithb | last post by:
I have a working ASP.NET 2.0 application that uses a GridView control. How can I enable the feature that allows a user to click on a column heading and sort the contents by the information in that column? Thanks, Keith
1
7112
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on the first column in the grid only. I havent found a way to reliably do this yet. I tried putting the following code in the datagrid's mouse down...
0
7868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6553
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.