Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14

    Unanswered:

    in your query #1 the FROM clause is missing.
    EXAMPLE QUERY #1
    @@ PARAMETER@@
    FLOW = 100
    PRESSURE = 5
    @@@@@@@@@@

    PARAMETERS FLOW as INT, PRESSURE as INT;
    SELECT TOP 1 FLOW, PRESSURE, [MACHINE]!MODEL, [MOTOR]!MOTOR, [COST]!COST
    WHERE [MACHINE].MODEL = [MOTOR].MACHINE
    ORDER BY [COST].COST
    Have a nice day!

  2. #2
    Join Date
    Jun 2015
    Posts
    4
    Quote Originally Posted by Sinndho View Post
    in your query #1 the FROM clause is missing.
    The error has been fixed. The question is still unanswered.

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I seriously doubt that you have no problem running the query, even with the FROM clause you added:
    1. The syntax used for the declaration of the parameters is incorrect in Access (Acc97, Acc2000, Acc2003, Acc2010, Acc2013 and Acc2016-Preview), see ScreenShot001:
    Click image for larger version. 

Name:	ScreenShot001.jpg 
Views:	3 
Size:	48.2 KB 
ID:	16449
    Code:
    PARAMETERS FLOW as Long, PRESSURE as Long;
    The correct syntax is:
    Code:
    PARAMETERS FLOW Long, PRESSURE Long;
    2. Where does COST!COST come from? There is no reference to a COST table in the FROM clause of the query, it is then treated as a parameter, see ScreenShot002:

    Click image for larger version. 

Name:	ScreenShot002.jpg 
Views:	3 
Size:	34.9 KB 
ID:	16450

    3. Although it's not formally incorrect and does not cause any error, it does not make sense to link two tables with an INNER JOIN clause, then repeat the link in a WHERE clause. It's either one or the other, see ScreenShot003:

    Click image for larger version. 

Name:	ScreenShot003.jpg 
Views:	2 
Size:	24.9 KB 
ID:	16451

    Except for some general considerations that would not be very useful, it's hard to help you if we don't know the exact SQL expression you're using in your query. Please open the query in SQL view and use the Copy/Paste functionalities of Windows to post the query as it is.
    Have a nice day!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •