Reputation: 95
Because this thing is due tomorrow I really need the help of our lovely community, right now I just started learning MS Access and SQL but encountered some difficulties.
What I want to do is a simple query, we can call it as a activity query, which will show us the activity of a member of the group in projects (proiect).
Here I have the table with the projects in which each member of a group participated.
ID-p-m
is the ID of the project manager in the databaseID-p-t
is the ID of each team member in the database ( Bart - 5 ; Donny - 8 ; Mike - 9)The query I am trying to make has as the user input the ID of the member.
Let's say ( 12 )
What I would like to get is something looking like this :
The raw code is kinda like this
Get ID ( in our case 12 ).
Analyze column ID-p-m;
if ID-p-m LIKE Get-ID:
get- Nume Proiect ,
print in Took part : [Nume Proiect] + " - Project Manager "
Analyze column ID-p-t;
if ID-p-t LIKE Get-ID:
get- Nume Proiect ,
print in Took part : [Nume Proiect] + " - Project Team "
I can resolve the name part by myself, the hard thing for me is the " Took part:" thing... I really look forward to learning access and sql, but right now I need your help because this is due tomorrow.
Some literature on on how to do this, would also be awesome.
Upvotes: 0
Views: 36
Reputation: 27644
Your table structure violates the First normal form, and this makes your query really difficult.
You should have:
ProjectID
ProjectName
PeopleID
PeopleName
This is a junction table to create the many-to-many relationship between Projects and People!
ProjectID
PeopleID
Role (e.g. "Project Member" or "Project Manager")
With the right table structure, your query will follow almost by itself.
Upvotes: 1