Solved

repeat regions..ASP..MSSQL and NOT repeating

Posted on 2004-09-01
2
270 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
Comment Utility
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
Comment Utility
BTW as for mental state depends on if what you were smokin was any good ;-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now