Results 1 to 9 of 9
  1. #1
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246

    Error FROM clause of your SQL statement

    Database52.zip

    Click image for larger version. 

Name:	From SQL Statement.jpg 
Views:	11 
Size:	23.3 KB 
ID:	12367

    I went to the SQL Statement and I dont see a FROM that has to do with this field:

    SELECT [Purchase Order Details].*, [Quantity]*[Standard Cost] AS [Extended Price], Products.[Product Name]
    FROM Products LEFT JOIN [Purchase Order Details] ON Products.ID = [Purchase Order Details].[Product ID];

    I have checked both Purchase Order Details and Product tables and I am not seeing where there is an issue.



    Attached is the DB for Access 2010 - I can not save it to an earlier version due to other macros and what not that is being used in the rest of the program.

    I thank anyone that can help me from the bottom of my heart

    Respectfully,

    Stephanie

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The error is uncommonly descriptive and accurate. You have that field in both tables. You need to specify which to use in the calculation.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Click image for larger version. 

Name:	From SQL to Design.jpg 
Views:	7 
Size:	103.5 KB 
ID:	12369

    Ok I am confused - i been told multiple times that when something is related to each other must have the same field names and either both Numeric or Text but not different.

    So here I have both with same field names and it only shows coming from one to the other..

    Can you tell me by this where I went wrong?

    Thanks

    Stephanie

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I could tell from the first post. You have this:

    [Quantity]*[Standard Cost] AS [Extended Price]

    It doesn't know which table's [Standard Cost] you want used in that calculation.

    I'm not sure what you mean by "when something is related to each other must have the same field names and either both Numeric or Text but not different". If you mean the fields in the JOIN, they do need to be the same data type, but they don't have to have the same name (which they don't in your case).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    ok under where it says Extended in the section FROM i selected Products - i saved that query - went back to open Purchase Order List Form and i am still getting the same error- so i went back to that query and it shows it not saved - did it again...and still will not save

    now how can i get this to save so it reads only from ONE table?

    Thanks

    Stephanie

  6. #6
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Ok the same thing is happening to my following queries...and it has to do with this Standard Price (i included the DB above and nothing has changed since posting that)

    Product Sales by Category - I get the enter paramenter Value for Standard Pricing
    Product Sales by Total to Date - I get the enter parameter Value for Standard Pricing
    Product Details Extended - get the FROM clause of your SQL statement regarding the Standard Pricing
    Price Purchase Totals - - get the FROM clause of your SQL statement regarding the Standard Pricing
    Purchase Summary - get the FROM clause of your SQL statement regarding the Standard Pricing

    the forms that is being affected by all this:
    Purchase Order Details
    Purchase Order List

    On Reports its affecting:
    Product Sales by Category
    Product Sales by Revenue
    now Product details is not having this problem as the control for this is from Products which the others should be too...corrrect?

    HELP :-)

    this is holding me up big time..ughhhh

    TIA

    Stephanie

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Without seeing the SQL of the query I would only be guessing. You have to add the table name here though:

    [Quantity]*TableName.[Standard Cost] AS [Extended Price]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    WOW...is that all it took? lol

    Thank youi so much again!! :-)

    IT WORKS! :-)

    Stephanie

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. syntax error in from clause
    By jskamm in forum Access
    Replies: 2
    Last Post: 09-18-2012, 09:13 AM
  2. Syntax Error in FROM clause
    By cjohnston in forum Queries
    Replies: 2
    Last Post: 02-15-2012, 07:33 AM
  3. Switch Statement in WHERE Clause
    By Gray in forum Queries
    Replies: 1
    Last Post: 06-02-2011, 06:50 AM
  4. Use of COLLATE statement in SELECT clause
    By zurek in forum Queries
    Replies: 7
    Last Post: 03-16-2011, 06:46 AM
  5. FROM Clause error message
    By skylite in forum Queries
    Replies: 2
    Last Post: 10-23-2008, 05: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