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 (1) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar