473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Table view

I'm currently displaying all the categories, subcategories
and courses i have in my databse in a table like

Math
Basic Math
Basic 101
Basic 202

accounting math
Math 101
Math 202

i wanted it to show like

Math
Basic Math Accounting math
Basic 101 Math 101
Basic 202 Math 202
This is my code so far

<%
SQL = "SELECT Categories.Category, Subcategories.Subcategory, [Course
Titles].Title FROM (Categories INNER JOIN [Course Titles] ON
Categories.ID = [Course Titles].CatID) INNER JOIN Subcategories ON
[Course Titles].SubcatID = Subcategories.ID ORDER BY
Categories.Priority, Subcategories.Priority"
RS.Open SQL, Conn

%>

<table>
<%
lastcat = ""
lastsub = ""

do while Not rs.eof
currcat = rs.Fields("category").Value
currsub = rs.fields("subcategory").value

if lastcat <> currcat then
%>
<tr>
<td>
<%=currcat%>
</td>
</tr>
<%
end if
%>

<%
if lastsub <> currsub then
%>
<tr>
<td>
<%=currsub%>
</td>
</tr>
<%
end if
%>
<tr>
<td>
<%=Server.HTMLEncode(rs.Fields("Title").Value)% </td>
<%
lastcat = currcat
lastsub = currsub
rs.MoveNext
loop
%>
</table>

Thanks
Jul 19 '05 #1
0 1171

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
2
by: WertmanTheMad | last post by:
MVP's and the like I am looking for suggestions , confirmation Let me start by saying bar none, performance is paramount with the queries to be retured off this view/table query. To that...
2
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message....
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
11
by: Paul Reddin | last post by:
Hi, This is a real hopeful one! What we are trying to do: 1. We MUST present a mappable database object for our application objects i.e a Table or a View Some of the views are very...
4
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
7
by: david | last post by:
I have asked this question before. But it does not work for me. Given radion buttons in the web form design page. What I did is described as follows. A panel control is dragged into the design...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
15
by: Piero 'Giops' Giorgi | last post by:
Hi! I have a question: I already have a DB that uses partitions to divide data in US Counties, partitioned by state. Can I use TWO levels of partitioning? I mean... 3077 filegroups and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.