Results 1 to 6 of 6
  1. #1
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16

    multiple inner joins getting syntax error

    I am beating my head against a wall on this one.
    The query below generates this error
    "Syntax error (missing operator) in query expression '(Ebay_posting.id=cint(order_items.ebaynumber)) inner JOIN inventory ON (Ebay_posting.description=inventory.ID'."
    I and a bit new to using joins but I cannot see the issue here.




    Code:
    SELECT  order_items.itemID,	order_items.order_id,
    	 order_items.ebaynumber,
    	 order_items.qty,
    	 order_items.shipping_charged, 
    	order_items.shipping_cost, 
    	order_items.defaultedby, 
    	order_items.defaulteddate, 
    	order_items.org_customer, 
    	order_items.mac, 
    	order_items.itemtotal, 
    	nz(order_items.itemtotal,0)+nz(order_items.shipping_charged) AS gross, 
    	(nz(order_items.itemtotal,0)+nz(order_items.shipping_charged))-order_items.shipping_cost AS net, 
    	Ebay_posting.price, 
    	Ebay_posting.lots_of, 
    	inventory.Inventoryid
    FROM Ebay_posting inner JOIN order_items ON (Ebay_posting.id=cint(order_items.ebaynumber))
                      inner JOIN inventory   ON (Ebay_posting.description=inventory.ID);

    I built this in steps and it worked until I added the parts in red.
    Any Ideas?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why don't you use the Access query builder to get the correct syntax?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    Quote Originally Posted by June7 View Post
    Why don't you use the Access query builder to get the correct syntax?
    because of
    Code:
     Ebay_posting inner JOIN order_items ON (Ebay_posting.id=cint(order_items.ebaynumber)) 

    I cannot use access to display this query I have to execute and edit it via SQL view. I did an simpler version of the join letting access set the syntax
    and here it is below and this worked as expected
    Code:
    SELECT Ebay_posting.description, Ebay_posting.ebay_item, inventory.description, inventory.Inventoryid
    FROM Ebay_posting INNER JOIN  inventory ON inventory.[ID] = Ebay_posting.[description];

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sorry, I don't understand why cannot use query designer.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16

    solved it.

    I was missing some brackets.

    Code:
    SELECT order_items.itemID, order_items.order_id, order_items.ebaynumber, order_items.qty, order_items.shipping_charged, order_items.shipping_cost, order_items.defaultedby, order_items.defaulteddate, order_items.org_customer, order_items.mac, order_items.itemtotal, nz(order_items.itemtotal,0)+nz(order_items.shipping_charged) AS gross, (nz(order_items.itemtotal,0)+nz(order_items.shipping_charged))-order_items.shipping_cost AS net, Ebay_posting.price, Ebay_posting.lots_of
    FROM ((Ebay_posting INNER JOIN order_items ON Ebay_posting.id=cint(order_items.ebaynumber)) inner JOIN inventory   ON (Ebay_posting.description=inventory.ID));

    the reason I cant use access design view is that when I try to view it in design view I get
    "Microsoft Access can't represent the join expressed Ebay_posting.id=cint(order_items.ebaynumber in design view"
    and if i take cint() out the query give me mismatched in date in query.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    My suggestion was to use design view WITHOUT that additional table join. Use the designer to then add in the table and set the link.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Inner Joins
    By comfygringo in forum Queries
    Replies: 5
    Last Post: 09-03-2013, 10:49 PM
  2. Replies: 6
    Last Post: 06-21-2013, 08:14 AM
  3. sql problems with multiple inner joins
    By mejia.j88 in forum Queries
    Replies: 1
    Last Post: 01-03-2012, 05:41 PM
  4. Multiple outer joins - error message
    By Lipi in forum Queries
    Replies: 1
    Last Post: 09-16-2010, 02:44 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums