Solved

repeat regions..ASP..MSSQL and NOT repeating

Posted on 2004-09-01
2
278 Views
Last Modified: 2010-04-25
Ok
I've queried two tables as such
SELECT dbo.tutee.idratuteeid AS idratuteeid,  
 dbo.tutee.firstname AS tutee_fisttname,        
dbo.tutee.lastname AS tutee_lastname,        
dbo.tutee.mi as tutee_mi,      
  dbo.tutee.gradelevel as gradelevel,      
  dbo.tutee.room as room,    
     dbo.tutee.elemteacherid as tutee_elemteacherid,        
dbo.elemteacher.elemteacherid as teacher_elemteacherid,    
    dbo.elemteacher.firstname as teacher_firstname,      
  dbo.elemteacher.lastname as teacher_lastname,
 dbo.studentdemo.idrastudentid as studentdemoidrastudentid,  
dbo.tutee.idrastudentid as tuteeidrastudentid,  
dbo.studentdemo.firstname as tutorfirstname,
 dbo.studentdemo.lastname as tutorlastname

FROM dbo.tutee, dbo.elemteacher, dbo.studentdemo

WHERE dbo.elemteacher.elemteacherid=dbo.tutee.elemteacherid  AND dbo.tutee.idrastudentid=dbo.studentdemo.idrastudentid  AND dbo.tutee.teachercoordid = MMColParam

And This works for lots of different things....bnut
Now I'm looking for to make a repeated region where the tutorfirstname that is associated with several tutees ONLY shows up once as the repeated region is populated
Right now it just gives me a list like this

tutee tuteeinfo tutorone
tuteeone tuteeinfo tutorone
tuteetwo  tuteeinfo tutorone

tutee tuteeinfo tutortwo
tuteeone tuteeinfo tutortwo
tuteetwo  tuteeinfo tutortwo

What I would like to see is

Tutorone
tutee tuteeinfo
tuteeone tuteeinfo
tuteetwo  tuteeinfo

Tutortwo
tutee tuteeinfo
tuteeone tuteeinfo
tuteetwo  tuteeinfo

I figure that this is an ASP question and not really a SQL question but I included the SQL statement
Is there any way to simply tweak Dreamweaver's repeated region behaviors...or am I just high

0
Comment
Question by:hbojorquezgeek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
ecupd earned 500 total points
ID: 11969660
typed all this in yesterday then clicked accidently clicked back and lost it GRRR

Hi hbojorquezgeek,

You will have to get into the code a tiny bit rather that relying on DW's inbuilt functions (to the best of my knowledge anyhows)

First thing add to the end of your SQL (after MMcolParam) so this will work the following:
& " ORDER BY dbo.studentdemo.firstname"
this will ensure the info comes out in the correct order for this to work

at the moment you have something akin to:
-------------------------------
 <table>
 <% While ((Repeat1__numRows <> 0) AND (NOT recordset1.EOF)) %>
<tr>
<td><%=(recordset1.fields.item("tutorfirstname").value)%></td>
<td><%=(recordset1.fields.item("tutee_fisttname").value)%></td>
<td><%=(recordset1.fields.item("tutee_lastname").value)%></td>
</tr>
 <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  recordset1.MoveNext()
Wend
%>
</table>
---------------------------------------
replace it with the following should work:
---------------------------------------
 <table>
 <% While ((Repeat1__numRows <> 0) AND (NOT recordset1.EOF)) %>
 <% if temporaryVariable <> recordset1.fields.item("tutorfirstname").value then %>
 <!--
        #### this will only display for the first instance of a new tutorfirstname
        ####in the first case temporaryvariable  will be nothing in all subsequent cases temporaryvariable will be the previous record
  -->
      <tr><td colspan="2"><%=(recordset1.fields.item("tutorfirstname").value)%></td></tr>
 <% end if %>
 <!-- #### all this will display regardless - edit to suit, edit what needs to be displayed -->
<tr>
<td><%=(recordset1.fields.item("tutee_fisttname").value)%></td>
<td><%=(recordset1.fields.item("tutee_lastname").value)%></td>
</tr>
 <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1

  '#### this is where we set the temporary variable so the check can be done at the top
  temporaryVariable = recordset1.fields.item("tutorfirstname").value
 
  recordset1.MoveNext()
Wend
%>
----------------------------------------

If I have missed anything paste the resulting generated HTML (view source in browser) and I will take a peek

Cheers,

dayton
0
 
LVL 2

Expert Comment

by:ecupd
ID: 11969666
BTW as for mental state depends on if what you were smokin was any good ;-)
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lock Form Controls 3 315
Adobe Web Premium CS3 5 390
CSS HTML Text Alignment 13 436
MAC Dreamweaver connect to external MS SQL Server 2 39
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question