Solved

repeat regions..ASP..MSSQL and NOT repeating

Posted on 2004-09-01
2
274 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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