Solved

How can I remove duplicates from list box

Posted on 2008-10-14
2
288 Views
Last Modified: 2012-05-05
Hi experts,

I have the following SQL statement:

SELECT DISTINCT XKIncidentTasks.IncidentTaskID, XKIncidentTasks.Sequence, XKIncidentTasks.IncidentTask, XKIncidentTasks.IncidentTaskDuration
FROM XKIncidentTasks
ORDER BY XKIncidentTasks.Sequence;


My table XKIncidentTasks contains 59 records. All have an autonumber which is "IncidentTaskID".  Around 15 of these records all contain the same text in the field "IncidentTask".  I would like to remove these 15 records from my list box.  I do not want to delete them from the table.

I have tried using the DISTINCT coding in my SQL but this does not work because Access does not see any duplicate records due to the "IncidentTaskID" field.  I need the "IncidentTaskID" to be present in my list box.

Can anybody help me?

Thank you.
Terry
0
Comment
Question by:TerenceHewett
2 Comments
 
LVL 2

Accepted Solution

by:
Monky42 earned 500 total points
ID: 22710126
add GROUP BY XKIncidentTasks.IncidentTask
Then DISTINCT will make sure only mutually different IncidentTasks are shown.
0
 

Author Comment

by:TerenceHewett
ID: 22710155
Thank you very much for your help.  This worked a treat.  All I needed to do was Group the IncidentTask and "Sum" the rest of my fields in the query.

Best regards
Terry
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

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