Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2007, 03:55 PM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Inner join query with multiple tables..

Syntax wise this looks perfect but not sure what stops access executing it...

select *
from timesheet t
        inner join teammaster tm on t.teamid = tm.teamid
        inner join worktype w on t.wtid = w.wtid
where t.tsid = 56403

it says "Syntax error missing operator..bla bla"

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old April 6th, 2007, 10:47 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Shouldn't that be:

select tablename.fieldname, tablename.fieldname, etc (not * when more than one table)
from timesheet t, teammaster As tm, worktype As w
        inner join teammaster tm on t.teamid = tm.teamid
        inner join worktype w on t.wtid = w.wtid
where t.tsid = 56403

Did that help? I would do this in the designer, and then copy the SQL from SQL View.


mmcdonal
 
Old April 9th, 2007, 11:16 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

forget "AS" between timesheet and t it should be
select *
from timesheet AS t

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to inner join tables gilgalbiblewheel Classic ASP Databases 4 January 31st, 2005 08:04 PM
Join Tables tdaustin Classic ASP Basics 1 May 25th, 2004 07:31 AM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM
Inner Join multiple tables qwprince Classic ASP Databases 5 July 23rd, 2003 02:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.