Solved

Displaying Single value from GetRows Array

Posted on 2008-06-12
6
738 Views
Last Modified: 2008-06-12
I am getting a resultset using .GetRows()

Every record has a RegName, ReggdName, RegDate

So if I go and register 4 users, the resultset returns

kevp75    OtherName    6/11/2008
kevp75    OtherName1    6/11/2008
kevp75    OtherName2   6/11/2008
kevp75    OtherName3    6/11/2008


how can I make it so only the first instance of kevp75 shows?
0
Comment
Question by:kevp75
  • 4
6 Comments
 
LVL 25

Author Comment

by:kevp75
ID: 21770071
in other words, I want to take this:
kevp75    OtherName    6/11/2008
kevp75    OtherName1    6/11/2008
kevp75    OtherName2   6/11/2008
kevp75    OtherName3    6/11/2008

and turn it into this:

kevp75    OtherName    6/11/2008
                OtherName1    6/11/2008
                OtherName2   6/11/2008
                OtherName3    6/11/2008
0
 
LVL 82

Expert Comment

by:hielo
ID: 21770103
k=rs.GetRows(1,0)

Response.Write( k(0,0)) 'kev75
Response.Write( k(0,1) ) 'OtherName
Response.Write( k(0,2) ) '6/11/2008
0
 
LVL 25

Author Comment

by:kevp75
ID: 21770364
hielo.  I need to get all the rows.  please see my second post....

also...

it will show different users for the first name on it...so like this:

kevp75    OtherName    6/11/2008
kevp75    OtherName1    6/11/2008
kevp75    OtherName2   6/11/2008
kevp75    OtherName3    6/11/2008
me75    OtherName1    6/11/2008
me75    OtherName11    6/11/2008
me75    OtherName12   6/11/2008
me75    OtherName13    6/11/2008

needs to be like:

kevp75    OtherName    6/11/2008
                OtherName1    6/11/2008
                OtherName2   6/11/2008
                OtherName3    6/11/2008
me75    OtherName1    6/11/2008
             OtherName11    6/11/2008
             OtherName12   6/11/2008
             OtherName13    6/11/2008
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 25

Author Comment

by:kevp75
ID: 21770444
code:

please assume this resides in between a With Response block
<%
set rs = Conn.Execute(strSql)
	if not(rs.eof) then
		urArr = rs.getrows()
	end if
set rs = Nothing
.write("<div style=""margin:0 auto;width:800px;padding:15px 0 15px 0;font-weight:bold;"">Registrations</div>" & vbcrlf)
if isarray(urArr) then 'make sure it's an array first
	.write("<table cellpadding=""2"" cellspacing=""0"" style=""width:800px;border-top:1px solid #333;border-right:1px solid #333;border-left:1px solid #333;margin:0 auto;"">" & vbcrlf)
	.write("	<tr>" & vbcrlf)
	.write("		<td colspan=""4""><strong>Event ID: </strong>" & tmp_Event_ID & "</td>" & vbcrlf)
	.write("	</tr>" & vbcrlf)
	.write("	<tr>" & vbcrlf)
	.write("		<td colspan=""4""><strong>Event Name: </strong>" & tmp_Event_Name & "</td>" & vbcrlf)
	.write("	</tr>" & vbcrlf)
	.write("	<tr>" & vbcrlf)
	.write("		<td colspan=""4""><strong>Event Date/Time: </strong>" & tmp_Event_Date & "</td>" & vbcrlf)
	.write("	</tr>" & vbcrlf)
	.write("	<tr>" & vbcrlf)
	.write("		<td style=""width:33%;font-weight:bold;border-bottom:1px solid #333;border-top:1px solid #333;background:#DDD;"">Registered By</td>" & vbcrlf)
	.write("		<td style=""width:33%;font-weight:bold;border-bottom:1px solid #333;border-top:1px solid #333;background:#DDD;"">Member Name</td>" & vbcrlf)
	.write("		<td style=""width:33%;font-weight:bold;border-bottom:1px solid #333;border-top:1px solid #333;background:#DDD;"">Birthdate</td>" & vbcrlf)
	.write("		<td style=""font-weight:bold;border-bottom:1px solid #333;text-align:center;border-top:1px solid #333;background:#DDD;"" nowrap>Headcount</td>" & vbcrlf)
	.write("	</tr>" & vbcrlf)
	.write("" & vbcrlf)
	tmp_Count = 0
	totRHC = 0
	for i = 0 to ubound(urArr,2) 'write out the individual rows for the registered users
		totRHC = totRHC + urArr(2,i)
		uRegged = urArr(6,i)
		.write("	<tr>" & vbcrlf)
		.write("		<td style=""width:33%;border-bottom:1px solid #333;"">" & uRegged & tmp_Count & "&nbsp;</td>" & vbcrlf)
		.write("		<td style=""width:33%;border-bottom:1px solid #333;"">" & urArr(5,i) & "&nbsp;</td>" & vbcrlf)
		.write("		<td style=""width:33%;border-bottom:1px solid #333;"">" & ubd(urArr(1,i)) & "&nbsp;</td>" & vbcrlf)
		.write("		<td style=""border-bottom:1px solid #333;text-align:center;"" nowrap>" & urArr(2,i) & "&nbsp;</td>" & vbcrlf)
		.write("	</tr>" & vbcrlf)
		next : i = Null : uRegged = Null: tmp_Count = Null
	.write("	<tr>" & vbcrlf)
	.write("		<td colspan=""3"" style=""font-weight:bold;background:#DDD;text-align:right;border-bottom:1px solid #333;"">Total Headcount:</td>" & vbcrlf)
	.write("		<td style=""font-weight:bold;background:#DDD;text-align:center;border-bottom:1px solid #333;"">" & totRHC & "</td>" & vbcrlf)
	.write("	</tr>" & vbcrlf)
	.write("</table>" & vbcrlf)
	Erase urArr
end if

Open in new window

0
 
LVL 13

Accepted Solution

by:
jmundsack earned 500 total points
ID: 21770480
Is the output in a <table>?

If so:

<%
' warning: air code
Dim arrData
Dim i
Dim strCurrName
strCurrName = ""
' missing: code to load recordset into arrData using GetRows
Response.Write "<table>"
Response.Write "<th>RegName</th>"
Response.Write "<th>ReggdName</th>"
Response.Write "<th>RegDate</th>"
For i = LBound(arrData, 2) To UBound(arrData, 2)
    Response.Write "<tr>"
    If strCurrName <> arrData(0, i) Then
        strCurrName = arrData(0, i)
        Response.Write "<td>" & strCurrName & "</td>"
    Else
        Response.Write "<td>&nbsp;</td>"
    End If
    Response.Write "<td>" & arrData(1, i) & "</td>"
    Response.Write "<td>" & arrData(2, i) & "</td>"
    Response.Write "</tr>"
Next
Response.Write "</table>"
%>

Open in new window

0
 
LVL 25

Author Comment

by:kevp75
ID: 21770554
cool.
thanks!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding Datediff to staistics page 2 63
sql to convert to date IF entry is in date format 4 94
Cannot open file from ASP if user is "logged in" 13 30
Html Table looping 4 26
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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