Gasman
Enthusiastic Amateur
- Local time
- Today, 00:10
- Joined
- Sep 21, 2011
- Messages
- 16,612
Hi all,
In need of some help please.
I have my very first Access database, that generates the reports at www.bibby-gazette.co.uk, emulating a Gazette we used to get twice a year, when we were at sea.
The whole DB hinges on a links table that literally does that, it links to
Dates
Ships
Rank
Crew
plus an autonumber ID
I have now the need to add a Dept to the crew table, as I have discovered that I have the same ID & Name, allocated to different departments. An example is Ashcroft, A who is in the DB as a Chef and also Electrical Officer.
Not a mistake, just that two people had the same surname and initials.
So I want to identify where I have such 'dupes' and add the name again and allocate to another dept and then add relevant records for the new crew member.
I have managed to create a query that groups ID, Surname with Initials and Dept, taken from a newly created tblDept and using their rank from the links table.
The query for that is
This shows output like
As you can see 2381 Ashcroft is in E for Engineering and also S for Service.
I am trying to find all occurrences like these, but have drawn a blank. I have tried various groupbys to no avail.
I intend to turn this query into an update query to update the crew table with a value for my newly created Dept field in that table, but for now, just trying to identify the names I need to add again, but as a different dept.
I know I should be able to do this, but for some strange reason drawn a blank, so a hint/solution would be nice.
DB is available is needed. There is no confidential data in the DB.
It is larger than needed as I have all sorts of queries etc that you create on your first couple of DBs.
TIA
In need of some help please.
I have my very first Access database, that generates the reports at www.bibby-gazette.co.uk, emulating a Gazette we used to get twice a year, when we were at sea.
The whole DB hinges on a links table that literally does that, it links to
Dates
Ships
Rank
Crew
plus an autonumber ID
I have now the need to add a Dept to the crew table, as I have discovered that I have the same ID & Name, allocated to different departments. An example is Ashcroft, A who is in the DB as a Chef and also Electrical Officer.
Not a mistake, just that two people had the same surname and initials.
So I want to identify where I have such 'dupes' and add the name again and allocate to another dept and then add relevant records for the new crew member.
I have managed to create a query that groups ID, Surname with Initials and Dept, taken from a newly created tblDept and using their rank from the links table.
The query for that is
Code:
SELECT Crew.ID, Trim([Surname]) & " " & [Initials] AS Name, Rank.Dept
FROM Dates RIGHT JOIN (Ship RIGHT JOIN (Crew RIGHT JOIN (Rank LEFT JOIN Links ON Rank.ID = Links.Rank) ON Crew.ID = Links.Crew) ON Ship.ID = Links.Ship) ON Dates.ID = Links.Date
GROUP BY Crew.ID, Trim([Surname]) & " " & [Initials], Rank.Dept
ORDER BY Trim([Surname]) & " " & [Initials];
This shows output like
As you can see 2381 Ashcroft is in E for Engineering and also S for Service.
I am trying to find all occurrences like these, but have drawn a blank. I have tried various groupbys to no avail.
I intend to turn this query into an update query to update the crew table with a value for my newly created Dept field in that table, but for now, just trying to identify the names I need to add again, but as a different dept.
I know I should be able to do this, but for some strange reason drawn a blank, so a hint/solution would be nice.

DB is available is needed. There is no confidential data in the DB.
It is larger than needed as I have all sorts of queries etc that you create on your first couple of DBs.

TIA