If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with a query help please
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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Query Problem | jacob | Running & Setting Up Queries | 0 | May 26th, 2005 09:46 PM |
Annual count queries on a field relative to a value that varies DA | tobesus | General Discussion | 7 | May 10th, 2005 07:50 AM |
Problem with query and table joins | Chuck Mueller | Running & Setting Up Queries | 1 | February 18th, 2005 04:08 PM |
WORD XP mail-merge FAILS using ACCESS Query | SueMackay | Mailmerge | 1 | November 23rd, 2004 01:03 PM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |