Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The Boss wants to generate and attendance list for training from the staff database, does not want a unique identifier like a social security number, prefers to enter a Lastname, and have that person added to the list.

I run into an issue when multiple people have the same last name, would like it to ask me for a first name only when a duplicate Lastname is found...

What I have tried:

SQL
SELECT DISTINCT Staff.LastName, Staff.Firstname, Staff.Email
FROM Staff
WHERE {{Staff.Lastname}=[Lastname 1]} AND {{Staff.Firstname}=[Firstname 1]}};

//repeats for eight staff member inputs - max students for the training...
Posted
Updated 14-Sep-20 22:13pm
v2
Comments
Sandeep Mewara 15-Sep-20 0:35am    
Is email a mandatory field? If so, would suggest combine name and email as the identifier to differentiate people.
Member 14938351 15-Sep-20 1:22am    
The email is the reason the list is being generated, the only known is the name.
Maciej Los 15-Sep-20 4:13am    
You'll need to write a VBA code to create such of functionality.
Member 14938351 15-Sep-20 10:00am    
thanks... I will need to find a tutorial...
[no name] 15-Sep-20 9:55am    
So, how many people are we talking about? I know people get weird around employee / payroll records. Let HR sort it out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900