473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

logic help needed

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
Jul 19 '05 #1
3 1135
http://www.aspfaq.com/2241

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Don Grover" <sp******@assoft.com.au> wrote in message
news:#D**************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #2
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
"Don Grover" <sp******@assoft.com.au> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Jul 19 '05 #3
Thanks Aaron and Ray.
Im trying to code with a Migrain at the moment so not working on all
thrusters 8-).

Regards
Don

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
http://www.aspfaq.com/2241

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Don Grover" <sp******@assoft.com.au> wrote in message
news:#D**************@TK2MSFTNGP10.phx.gbl...
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


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xenophobe | last post by:
I'm having a brain freeze on how to go about creating the logic for evenly distributing a group of items in rotation through multiple iterations. I'm particularly looking for logic flow help and...
1
by: robert | last post by:
hi! there's a line in my Javascript program that makes a change in the appearance of an area of the screen. it is a game program, so there are a cascade of changes after the user makes a move....
22
by: James H. | last post by:
Greetings! I'm new to Python and am struggling a little with "and" and "or" logic in Python. Since Python always ends up returning a value and this is a little different from C, the language I...
2
by: Migrant | last post by:
Hi Friends; I want develop a group logic with C# (n tier refraction).I know I must create a Class and inherit it But I don't have enough know-how about develop classes. Somebody can help me? ...
8
by: - | last post by:
Hi to All, To reproduce: The expression: object result = flag ? (long) 0 : (double) 0; always evaluated as a double... see dissassembly to ensure the bad compiled code.
24
by: cassetti | last post by:
Here's the issue: I have roughly 20 MS excel spreadsheets, each row contains a record. These records were hand entered by people in call centers. The problem is, there can and are duplicate...
6
by: Simon Harvey | last post by:
Hi everyone, We have a need to make a Windows Forms (2.0) client application that will be installed on our clients site. The data that the application uses needs to be centrally available to a...
12
by: Bob Jones | last post by:
I have an odd business requirement and I think that the implementation is not correct in the terms of OOP development. Any help on the concepts would be very appreciated! We currently have a...
2
by: Chris Zopers | last post by:
Hello, I would like to know what's the best way to implement a business logic layer between my user interface and my database. I would say I'd make a dll-project for the business logic layer...
2
by: Matthew Woodcraft | last post by:
John Salerno <johnjsal@gmailNOSPAM.comwrote: You probably could, but it's best not to unless you're somehow forced to. In practice, the interface that you want your 'logic' layer to provide...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.