473,396 Members | 1,875 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.

Remove duplicate value

Hello everbody,

Please help me to remove the duplicate value. I have this code

Do until objRSEmail.eof

tgroup = objRSEmail("tEmailName")&"@city.com;"&tgroup

objRSEmail.MoveNext
Loop

the output of this is
john@city.com;john@city.com;smith@city.com

i want to have output like this(to remove the second occurence of same email address)
john@city.com;smith@city.com.


Thanks
Dec 3 '07 #1
5 3230
JamieHowarth0
533 Expert 512MB
Hy lyme,

Try:
Expand|Select|Wrap|Line Numbers
  1. For I = 1 To objRSEmail.RecordCount   
  2.          tgroup = tgroup & objRSEmail("tEmailName") & "@city.com;"
  3.     objRSEmail.MoveNext
  4. Next
  5.  
medicineworker
Dec 3 '07 #2
shweta123
692 Expert 512MB
Hi,

It is taking duplicate values for emailId because may be recordset objRSEmail is containing duplicate values. So you can write sql query that is required to fill up the recordset like this

Sql = "Select distinct tEmailName from tablename"


Hello everbody,

Please help me to remove the duplicate value. I have this code

Do until objRSEmail.eof

tgroup = objRSEmail("tEmailName")&"@city.com;"&tgroup

objRSEmail.MoveNext
Loop

the output of this is
john@city.com;john@city.com;smith@city.com

i want to have output like this(to remove the second occurence of same email address)
john@city.com;smith@city.com.


Thanks
Dec 3 '07 #3
The scenario of this is: John has 2 request and Smith has one request, once the request has been approved, the program will send email notification to the requestor.

in my code:
Do until objRSEmail.eof
tgroup = objRSEmail("tEmailName")&"@imiphil.com;"&tgroup

objRSEmail.MoveNext
Loop

In a tgroup variable, the system will check if there's already John@City.com then it will add the next email Smith@City.com. so the output will be John@City.com;Smith@City.com
not
John@City.com;John@City.com;Smith@City.com

THanks again
Dec 4 '07 #4
shweta123
692 Expert 512MB
Hi ,

Here you can check for duplicate values for EmailName using :

Do until objRSEmail.eof

If instr(tgroup ,objRSEmail("tEmailName"))=0 then
tgroup = objRSEmail("tEmailName")&"@City.com;"&tgroup
end if
objRSEmail.MoveNext
Loop



The scenario of this is: John has 2 request and Smith has one request, once the request has been approved, the program will send email notification to the requestor.

in my code:
Do until objRSEmail.eof
tgroup = objRSEmail("tEmailName")&"@imiphil.com;"&tgroup

objRSEmail.MoveNext
Loop

In a tgroup variable, the system will check if there's already John@City.com then it will add the next email Smith@City.com. so the output will be John@City.com;Smith@City.com
not
John@City.com;John@City.com;Smith@City.com

THanks again
Dec 4 '07 #5
JamieHowarth0
533 Expert 512MB
HI there,

Or you could just use the SELECT DISTINCT to select only unique email names?

medicineworker
Dec 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Patrick G. | last post by:
Greetings all: ASP VB, SQL Svr 2000 I am pulling data from 3 tables. table1 holds item details table2 holds publication types and the item id from table1 table3 holds category types and...
7
by: Voetleuce en fênsievry | last post by:
Hello everyone. I'm not a JavaScript author myself, but I'm looking for a method to remove duplicate words from a piece of text. This text would presumably be pasted into a text box. I have,...
1
by: TaeHo Yoo | last post by:
I have a table that has more than 1 milion rows so practically it is impossible to remove all duplicate rows by hand. Could you help me to remove those duplicate rows at all? This table doesn't...
1
by: guoqi zheng | last post by:
I have a dataset with about 20-50 records on it. Some of has the same value for a key column, those duplicates need to be removed. How can I remove duplicate itmes from a dataset???? I know...
3
by: dazzle | last post by:
I have an XML file and I would like to remove duplicate nodes within it but I can't get my head round on how to do this. Example XML file: <root> <plugin> <title>A9</title> <url>some...
20
by: David Levine | last post by:
I ran into a problem this morning with event accessor methods that appears to be a bug in C# and I am wondering if this a known issue. public event SomeDelegateSignature fooEvent; public event...
4
by: whatnameisnottaken | last post by:
right now i have gotten all the classes to print out using helpdbg. Now i want to remove the duplicate class names out of an array so i can just print one of each. This is the output i have. ...
1
by: vishwa Ram | last post by:
Hi ScriptFamily, I need to remove a duplicate value in array. Any specific method available in perl. pls suggest Regards Raam
8
natalie99
by: natalie99 | last post by:
hi everyone i have reseached this topic and cannot seem to find a solution that suits my problem, please help!! I have two tables, "Inventory" which contains 30,000 or so records, with about...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.