|
-
Nov 10th, 2004, 01:27 PM
#1
Thread Starter
Hyperactive Member
Access doesn't like this query
I have this query, but MS Access 2000 doesn't seem to like the second INNER JOIN, it tells me 'Synax, missing operator in query expression'
Is my query incorrect, or does Access not handle multiple joins? If so, how could I rewrite my query?
SELECT sms_contacts.ContactName + ',' + sms_outbox.Message
FROM sms_contacts
INNER JOIN sms_recipients ON sms_contacts.ContactID = sms_recipients.ContactID
INNER JOIN sms_outbox ON sms_recipients.smsID = sms_outbox.smsoutboxID
-
Nov 10th, 2004, 03:12 PM
#2
Hyperactive Member
I recreated your table structure and ran it through the Access query designer which gave me the same error.
However, when I switched to design view and created the joins visually, Access provided me with this SQL string:
Code:
SELECT sms_contacts.ContactName+','+sms_outbox.Message AS Expr1
FROM (sms_contacts INNER JOIN sms_recipients ON sms_contacts.ContactID = sms_recipients.ContactID) INNER JOIN sms_outbox ON sms_recipients.SMSID = sms_outbox.smsoutboxid
Access has put your joins in in a different order. I don't have time to check this out in SQL Query Analyser, but it should help you out with Access in the meantime.
If I can suss it out elsewere then I'll give you another shout.
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
Dr. Seuss 
-
Nov 10th, 2004, 04:45 PM
#3
Access requires the parentheses around the join expressions as in Lil Ms' code. In SQL Server, you can get away without the parens, but Access is pickier.
"It's cold gin time again ..."
Check out my website here.
-
Nov 11th, 2004, 03:23 AM
#4
Thread Starter
Hyperactive Member
Thanks people. One has to wonder why can't MS just make its access interpreter in the same style as SQL Servers? I mean for sure, take out some functionality, but why change the syntax requirements?
-
Nov 14th, 2004, 02:17 PM
#5
Thread Starter
Hyperactive Member
Bah, now when I finally try this query (on a Sunday night) in Access, it asks me for the ContactID???
In my actual program, it gives me an error, saying no value given for one or more required parameters..
I don't see anything wrong with the query...
Thanks
-
Nov 14th, 2004, 02:31 PM
#6
sms_contacts.ContactID and sms_recipients.ContactID exist in both tables
and are spelled like in your query?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 14th, 2004, 02:50 PM
#7
Thread Starter
Hyperactive Member
sms_contacts.ContactID and sms_recipients.ContactID exist in both tables and are spelled like in your query?
I'm not sure what you are asking, but yes, contactID field exists in both tables, my query is...
SELECT sms_contacts.ContactName+','+sms_outbox.Message AS Expr1
FROM (sms_contacts INNER JOIN sms_recipients ON sms_contacts.ContactID = sms_recipients.ContactID) INNER JOIN sms_outbox ON sms_recipients.SMSID = sms_outbox.smsoutboxid
-
Nov 14th, 2004, 06:12 PM
#8
Originally posted by greg_quinn
Thanks people. One has to wonder why can't MS just make its access interpreter in the same style as SQL Servers? I mean for sure, take out some functionality, but why change the syntax requirements?
ACCESS is MS home-grown attempt at SQL. MS SQL SERVER 2000 is a product developed by SYBASE - purchased by MS - and now taking over the SQL enterprise market (just don't ask Larry Elison what he thinks about that)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|