'q01_All Males at Y12
'Example 1 - Selecting Y12 male workers
'FAC code 6 is for Y12
'FAC1-Fac10 are checked to determine if they were ever employed at Y12
'
SELECT id
FROM [tblORISEWDS_d1 Master Roster]
WHERE (((sex)="M") AND ((fac1)="6")) OR
(((sex)="M") AND ((fac2)="6")) OR
(((sex)="M") AND ((fac3)="6")) OR
(((sex)="M") AND ((fac4)="6")) OR
(((sex)="M") AND ((fac5)="6")) OR
(((sex)="M") AND ((fac6)="6")) OR
(((sex)="M") AND ((fac7)="6")) OR
(((sex)="M") AND ((fac8)="6")) OR
(((sex)="M") AND ((fac9)="6")) OR
(((sex)="M") AND ((fac10)="6"));
'q02_Y12 Male vital stats
'Example 2 - Selecting vital status for Y12 males
'Import the Master vital status file
'
SELECT [tblORISEWDS_d6 Master vital status].*
FROM [q01_All Males at Y12] INNER JOIN [tblORISEWDS_d6 Master vital status] ON
[q01_All Males at Y12].id = [tblORISEWDS_d6 Master vital status].id;
'q03_CoD for Y12 males
'Example 3 - Selecting deceased males at Y12 and their cause of death
'Import the Death file
'
SELECT [tblORISEWDS_d7 Death].*
FROM [q01_All Males at Y12] INNER JOIN [tblORISEWDS_d7 Death] ON
[q01_All Males at Y12].id = [tblORISEWDS_d7 Death].id;
'q04_Y12 Males worked between 1980-2000
'Example 4 - Employment data for all males who were ever hired at
'Y12 between 1980 and 2000
'Import the Employment data
'
SELECT DISTINCT [tblORISEWDS_d2 Employment Data].id
FROM [q01_All Males at Y12] INNER JOIN [tblORISEWDS_d2 Employment Data] ON
[q01_All Males at Y12].id = [tblORISEWDS_d2 Employment Data].id
WHERE (((IIf(IsDate([hiredate])=True,CDate([hiredate]),Null))>=#1/1/1980#) AND ((IIf(IsDate([termdate])=True,CDate([termdate]),Null))<=#12/31/2000#));
' q05_Y12 Males wVital Stats between 1980-2000
' Example 5 - Y12 males ever hired between 1980-2000 and their vital status
'
SELECT [q03_CoD for Y12 males].*
FROM [q04_Y12 Males worked between 1980-2000] INNER JOIN [q03_CoD for Y12 males] ON [q04_Y12 Males worked between 1980-2000].id = [q03_CoD for Y12 males].id;
Below is the list of all queries used in the MS Access database: