Duane,
Just found out that there is an employee that is in a department with a specific dept. code but the dept. name is based on another department name. Will need to fix that. Thank You
Jim Wagner
On Wednesday, April 22, 2015 5:11 PM, "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
Jim,
Is [Dept ID] unique in [R&D-CURRENTEMPLOYEES]?
Duane Hookom, MVP
MS Access
To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Wed, 22 Apr 2015 22:11:42 +0000
Subject: [MS_AccessPros] Query results are different, can some one explain the difference.
Is [Dept ID] unique in [R&D-CURRENTEMPLOYEES]?
Duane Hookom, MVP
MS Access
To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Wed, 22 Apr 2015 22:11:42 +0000
Subject: [MS_AccessPros] Query results are different, can some one explain the difference.
Hello all,
I have been experimenting with queries and have a question why two queries have different dataset counts. Could someone shed some light on this query (pun intended)
Jim Wagner
I have a several tables being used
Student Positions has 38 records
LU_Dept is a table with all the departments, it has 29 records
R&D-CURRENTEMPLOYEES lists all the current employees. It has 481 records.
The first query is the original and has been in use for years
this query is qryStudentPositions it reports back 38 records
SELECT LU_Dept.DeptName, LU_Dept.Dept, [Student Positions].Deptid, [Student Positions].[Position Nbr], [Student Positions].Jobcode, [Student Positions].[Dist Pct], [Student Positions].[Acct Cd], [Student Positions].[Fiscal Year], [Student Positions].Effdt, [Student Positions].Effdt2, [Student Positions].Descr, [Student Positions].[Posn Status], [Student Positions].Fte
FROM [Student Positions] INNER JOIN LU_Dept ON [Student Positions].Deptid = LU_Dept.Dept
ORDER BY [Student Positions].[Position Nbr];
FROM [Student Positions] INNER JOIN LU_Dept ON [Student Positions].Deptid = LU_Dept.Dept
ORDER BY [Student Positions].[Position Nbr];
The new experimental query I am trying to avoid the LU_Dept table. It is the only place in the table that it is being used. So I would like to get rid of it if I can.
Query2 because it is experimental and it reports back 39 records
SELECT DISTINCT [R&D-CURRENTEMPLOYEES].[Dept Ld] AS DeptName, [R&D-CURRENTEMPLOYEES].[Dept Id], [Student Positions].Deptid, [Student Positions].[Position Nbr], [Student Positions].Jobcode, [Student Positions].[Dist Pct], [Student Positions].[Acct Cd], [Student Positions].[Fiscal Year], [Student Positions].Effdt, [Student Positions].Effdt2, [Student Positions].Descr, [Student Positions].[Posn Status], [Student Positions].Fte
FROM [Student Positions] INNER JOIN [R&D-CURRENTEMPLOYEES] ON [Student Positions].Deptid = [R&D-CURRENTEMPLOYEES].[Dept Id]
ORDER BY [Student Positions].[Position Nbr];
FROM [Student Positions] INNER JOIN [R&D-CURRENTEMPLOYEES] ON [Student Positions].Deptid = [R&D-CURRENTEMPLOYEES].[Dept Id]
ORDER BY [Student Positions].[Position Nbr];
Jim Wagner
__._,_.___
Posted by: Jim Wagner <luvmymelody@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar