logic help needed

D

Don Grover

I have a recordset that returns company names, their are duplicates, sorted
by company name.

sCompanyName = ors("company")

How can I show only one company name from each company and display nothing
for the next name if its the same in the previouse row,

COKE $2.14
$2.16
$2.16
PEPSI $3.13
$3.11
$3.12
FANTA $1.26
$1.26


Regards
Don
 
R

Ray at

Here's one way you can do it:

<%
Dim sOldName, sNewName, sCompanyName
sOldName = ""

Do While Not ors.EOF
sNewName = ors.Fields.Item(0).Value
sCompanyName = sNewName
If sCompanyName = sOldName Then sCompanyName = "&nbsp;"

%>
<tr>
<td><%=sCompanyName%></td>
<td>price code here</td>
</tr>
<%
sOldName = sNewName
ors.MoveNext
Loop

%>

Ray at work
 
D

Don Grover

Thanks Aaron and Ray.
Im trying to code with a Migrain at the moment so not working on all
thrusters :cool:.

Regards
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top