?
Solved

How can I remove duplicates from list box

Posted on 2008-10-14
2
Medium Priority
?
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Monky42 earned 2000 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

771 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