Problem with a query help please

G

Guest

I have a query that works but for some reason when I do the query. It put
some of the reps in the wrong area. And the and doesn't put some reps in the
right area . Could this be the database? I checked the table and these reps
are correct there. But not on the query. Its funny cause other reps are
fine.

Here is the code:

SELECT DISTINCT [WFM Reps].[Record #], [WFM Reps].[Code Number], [WFM
Reps].[First Name], [WFM Reps].[Last Name], [WFM Reps].Level, L_2.[Code
Number], L_2.[First Name], L_2.[Last Name], L_2.Level, L_3.[Code Number],
L_3.[First Name], L_3.[Last Name], L_3.Level, L_4.[Code Number], L_4.[First
Name], L_4.[Last Name], L_4.Level, L_5.[Code Number], L_5.[First Name],
L_5.[Last Name], L_5.Level, L_6.[Code Number], L_6.[First Name], L_6.[Last
Name], L_6.Level, L_7.[Code Number], L_7.[First Name], L_7.[Last Name],
L_7.Level, L_8.[Code Number], L_8.[First Name], L_8.[Last Name], L_8.Level,
L_9.[Code Number], L_9.[First Name], L_9.[Last Name], L_9.Level, L_10.[Code
Number], L_10.[First Name], L_10.[Last Name], L_10.Level
FROM [WFM Reps] LEFT JOIN (((((((([WFM Reps] AS L_2 LEFT JOIN [WFM Reps] AS
L_3 ON L_2.[Code Number] = L_3.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_4 ON
L_3.[Code Number] = L_4.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_5 ON
L_4.[Code Number] = L_5.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_6 ON
L_5.[Code Number] = L_6.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_7 ON
L_6.[Code Number] = L_7.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_8 ON
L_7.[Code Number] = L_8.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_9 ON
L_8.[Code Number] = L_9.[Sponsor Code]) LEFT JOIN [WFM Reps] AS L_10 ON
L_9.[Code Number] = L_10.[Sponsor Code]) ON [WFM Reps].[Code Number] =
L_2.[Sponsor Code]
ORDER BY [WFM Reps].[Code Number], L_2.[Code Number], L_3.[Code Number],
L_4.[Code Number], L_5.[Code Number], L_6.[Code Number], L_7.[Code Number],
L_8.[Code Number], L_9.[Code Number], L_10.[Code Number];
Code by SteveS" <sanfu at techie dot com> and thanks Steve for the code. I
used yours in stead of mine much easier to reader and decipher

Please help or give advice?

Thanks,

John
 
Top