>I'm having a problem with what should be a simple query, constructed using the query designer.
>
>I have 3 free tables involved: Reg_main, Reg_fb, and Hs.
>I want to combine (inner join) the corresponding records from each table. Here's the SQL command:
>
>SELECT Reg_main.reg_year, Reg_main.last, Reg_main.first, Reg_main.city,;
> Reg_main.st, Reg_fb.pos_num1, Reg_fb.pos_num2, Reg_fb.touchdowns,;
> Reg_fb.rush_yds, Hs.hs_name, Hs.city, Hs.state;
> FROM reg_main INNER JOIN reg_fb;
> INNER JOIN hs ;
> ON Reg_main.ceeb = Hs.ceeb ;
> ON Reg_main.registr_id = Reg_fb.registr_id;
> WHERE Reg_main.reg_year = '99';
> ORDER BY Reg_main.last
>
>However, when I run the query, each record has the same high school name. It's not moving the pointer through the hs table to correspond to the inner join.
>
>Does anyone have any idea why?
>
>Thanks,
>Neil Preston
Maybe first record has a spectacular touchdowns count :) Just kidding. Sorry couldn't resist.
As I could see at first glance main isthe linker to both tables. Then I would put main in middle :
SELECT Reg_main.reg_year, Reg_main.last, Reg_main.first, Reg_main.city,;
Reg_main.st, Reg_fb.pos_num1, Reg_fb.pos_num2, Reg_fb.touchdowns,;
Reg_fb.rush_yds, Hs.hs_name, Hs.city, Hs.state;
FROM reg_fb INNER JOIN reg_main ;
ON Reg_main.registr_id = Reg_fb.registr_id ;
INNER JOIN hs ;
ON Reg_main.ceeb = Hs.ceeb ;
WHERE Reg_main.reg_year = '99';
ORDER BY Reg_main.last
Also I just separated the "On .." parts for they're easier to set correctly this way.
Cetin