473,406 Members | 2,281 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,406 software developers and data experts.

Delete duplicate records

I have a form that collects data onto a table called "Dailyattendance" with columns "Cardno", "Name", "Sex", "Age" and "Dateofattendance".

In preventing duplicate records i would like to delete records that matches criteria of same cardno, name, and dateofattendace.

Can i please get help as to achieving that, probably with a code.

Pls note: Very new to VB

Thank you.
May 2 '15 #1
4 1479
Luuk
1,047 Expert 1GB
some thing like
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO MAIN
  2. SELECT X1.itemnumber AS itemnumber
  3. FROM X1
  4. WHERE not exists (select itemnumber
  5. from MAIN
  6. where MAIN.itemnumber = X1.itemnumber);
(source: here)


takes care of inserting only 1 record (if you expand this query with your own criteria)
May 2 '15 #2
zmbd
5,501 Expert Mod 4TB
Luuk, I don't think that is what op is after.

Coachafrane, your question needs an example if would you please because as worded the question makes very little sense. What you are descibing makes it sound like there is a flaw in the design of the database

Sent from ipad
May 2 '15 #3
Luuk
1,047 Expert 1GB
@zmdb: maybe this is not what OP is after,
I translated:
"In preventing duplicate records i would like to delete records ..."
to:
Why insert records that you do not want, and delete them afterwards. It would be simpler to not insert them at all.

But let's wait what OP (=coachafrane) has to say.....
May 3 '15 #4
zmbd
5,501 Expert Mod 4TB
Luuk,
That was one way I read the question and the other was that the records need to be "updated" with new or different information.
May 3 '15 #5

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

Similar topics

0
by: Joe | last post by:
I used LOAD DATA FILE to load data into a mysql database. I discovered that there are lots of duplicate records. Can anyone give me a simple list of mysql commands to search and destroy duplicate...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
4
by: KT | last post by:
Is there any one click solution that would do the trick? I would like to create a button, so the person who maintains the database can perform clean up work to delete duplicate records which...
16
by: Theodore70 | last post by:
I am trying to delete duplicate records in an access table using VB. Not a programmer here, but this was one of the codes that I found on the web. I made some modifications to it, but it still did...
4
by: smack | last post by:
I was able to get a query out showing all the duplicate records but know I need the duplicates to be sent to another table any ideas?
6
by: hisham123 | last post by:
hi, i had more duplicate records in my table. i want to keep one rest i want to delete. can you give me sql server 2000 query
7
by: AccessHunter | last post by:
I am using the following code to find and delete records in a table. The logic will go through each record and if a duplicate row is found will delete it. I ran this code and it worked the first...
6
by: Dilip1983 | last post by:
Hi All, I want to delete duplicate records from a large table. There is one index(INDEX_U1) on 4 columns(col1,col2,col3,col4) which is in unusable state. First of all when i tried to rebuild...
32
Brilstern
by: Brilstern | last post by:
I upload names into a database everyday and sometimes I am given duplicate names or names that have previously been submitted. Basically I want to delete all but the latest record based off of the...
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
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
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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.