Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "Help with If contains then" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #21  
Old May 14th, 2008, 02:04 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Ok, I added the case statement and changed the order by.

I am getting results like I want them but with one minor issue, my last region only has "repair" items but its not showing the "Repair" grouping for it.

shows like:
RegionOne
-Ready
Ready Item
Ready Item
-Repair
Repair Item
Repair Item
Repair Item
RegionTwo
-Ready
Ready Item
-Repair
Repair Item
.
.
.
...then LastRegion
Repair Item
Repair Item

Here is code, let me know if you need the query info.

Code:
<%
Dim strLastRegionName, strType
%>
<%
strLastRegionName = ""
strType = ""

	do while not rs.EOF
	if i > iStopRec then
		exit do
	end if

	strCurrentRegionName = rs("RegionName")
	
	If strCurrentRegionName<>strLastRegionName Then	
	Response.Write("<tr bgcolor=#D3D3D3><td colwidth=""100"" colspan=""10""><b>" & strCurrentRegionName & "</b></td></tr>")
	End If
	strLastRegionName = strCurrentRegionName
	
	strCurType = rs("Type")
	If strCurType <> strType then
	Response.Write("<tr bgcolor=yellow><td colwidth=""100"" colspan=""10""><b>" & strCurType & "</b></td></tr>")		
	End If
	strType = strCurType
	
	i = i + 1
%>

<TR>
<TD bgcolor=#ffe4e1 align=right><%=rs("Loc")%> &nbsp;</TD>
<TD bgcolor=#ffe4e1 align=center><%=rs("District_Location")%> &nbsp;</TD>
<TD align=center><%=rs("EQStatus")%> &nbsp;</TD>
<TD align=center><%=rs("TrackingStatus")%> &nbsp;</TD>
<TD align=center><%=rs("EQNumber")%> &nbsp;</TD>
<TD align=center><%=rs("Tools")%> &nbsp;</TD>
<TD align=center><%=rs("DaysStatus")%> &nbsp;</TD>
<TD align=center><%=rs("DaysSinceLast")%> &nbsp;</TD>
<TD align=center><%=rs("CurrCC")%> &nbsp;</TD>
<TD align=left><%=rs("RigPartner")%> &nbsp;</TD>
</TR>	
<%	
rs.MoveNext
loop
%>
<%
rs.Close
%>
Sponsored Links
  #22  
Old May 14th, 2008, 02:21 PM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 160
Thanks: 12
Thanked 29 Times in 27 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

try this:
Code:
If strCurrentRegionName<>strLastRegionName Then	
     Response.Write("<tr bgcolor=#D3D3D3><td colwidth=""100"" colspan=""10""><b>" & strCurrentRegionName & "</b></td></tr>")
     strType = ""
End If
__________________
Quote of the Month:
Quality: The race for quality has no finish line- so technically, it's more like a death march.

Questions to Ponder:
What do you do when you see an endangered animal eating an endangered plant?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
The Following 2 Users Say Thank You to mehere For This Useful Post:
jmurrayhead (May 27th, 2008), Rebelle (June 17th, 2008)
  #23  
Old May 14th, 2008, 02:47 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

That did it!!!! Thank you! Thank you!

  #24  
Old May 14th, 2008, 02:56 PM
mehere's Avatar
Super Sarcasm Mistress
 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 160
Thanks: 12
Thanked 29 Times in 27 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

np ... glad you got it sorted.
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 11:20 PM.



Content Relevant URLs by vBSEO 3.2.0