Hide Duplicate record using Query (1 Viewer)

pigkachu

Registered User.
Local time
Tomorrow, 04:07
Joined
May 5, 2015
Messages
12
Hi, i have a question on hiding duplication record using query.

The fields in the query are:
full name(trainee), NRIC(trainee), gender(trainee), preferred language(trainee), company(trainee), course name(course), course date(course), competent(course), class(course), L3 survey(trainee), L4 survey(trainee), num of month(course)

When the query is being run, it will show all the people that have not done the L3 and L4 survey after 3 month. The the query will be convert into a form. However the problem is that the record will show a few same name due to one person can take more than 1 course. therefore, the data in the course table will always be different.

How can i make the record only show 1 name even though they have different course name.

I had tried putting 'yes' for unique record and unique value but it did not change the result.

current SQL query:

SELECT DISTINCT trainee.[Full Name], trainee.NRIC, trainee.Gender, trainee.[Preferred Language], trainee.Company, course.[Course Name], course.[Course Date], course.Competent, course.Class, trainee.[L3 survey], trainee.[L4 survey], DateDiff('m',[Course Date],Date()) AS [Num of Month]
FROM trainee INNER JOIN course ON trainee.NRIC = course.NRIC
WHERE (((course.Competent)="c") AND ((trainee.[L3 survey])=False) AND ((DateDiff('m',[Course Date],Date()))>=3)) OR (((trainee.[L4 survey])=False) AND ((DateDiff('m',[Course Date],Date()))>=6));
 

llkhoutx

Registered User.
Local time
Today, 15:07
Joined
Feb 26, 2001
Messages
4,018
Group (all displayed columns), alternatively use another query to group duplicate rows
.
 

pigkachu

Registered User.
Local time
Tomorrow, 04:07
Joined
May 5, 2015
Messages
12
Hi llkhoutx,
Thanks for the reply! So i need to create another query design to group duplicate rows?
For the result display, i actually don't mind not showing all the courses the trainee attend. I just need the query to display 1 record for the person regardless of what course they taken
 

llkhoutx

Registered User.
Local time
Today, 15:07
Joined
Feb 26, 2001
Messages
4,018
You need to isolate the non-duplicate rows. There are a multitude ways of doing this.
 

pigkachu

Registered User.
Local time
Tomorrow, 04:07
Joined
May 5, 2015
Messages
12
I am quite new to the system. Do you mind providing some example so i can understand what you mean >.<
 

llkhoutx

Registered User.
Local time
Today, 15:07
Joined
Feb 26, 2001
Messages
4,018
Post the 2 tables populated with data in a zip file and I'll do it.
 

pigkachu

Registered User.
Local time
Tomorrow, 04:07
Joined
May 5, 2015
Messages
12
This is the system i am currently doing. As you can see from the due survey tab. there is duplicate record due to the person have different course name.

I only need the name to appear one time based on the earliest date the person take the course
 

Attachments

  • L3L4 example.zip
    332.6 KB · Views: 133

Users who are viewing this thread

Top Bottom