Results 1 to 6 of 6
  1. #1
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    168

    Hidden SQL Statements

    I'm learning access and have been mimicking queries from the Northwind database



    If you duplicate the "10 most expensive products" exactly as it shows in design view, it does not operate the same as the original query in the NorthWind database

    (after tearing some hair out) I found this is because in the SQL view there is an extra "TOP 10" added to the SQL statement.


    A. is there a way to create a "TOP 10" query using just the design view? meaning not having to manually enter the SQL "TOP 10" statement?


    B. is there a way to tell when a query has been edited or added to using SQL that can not be generated in the design view?

    Thanks for any thoughts or help

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    A. yes, put it in design view then set the TOP property.
    B. no. well,except union queries. but you could hide the query so they cant see or edit it. set visible property = no.
    Last edited by ranman256; 02-21-2020 at 02:57 PM.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    There are also certain joins that can't be represented in design view (non-equi join comes to mind). It may help to think of design view as a GUI that makes it easier to create/maintain SQL. SQL is what the database engine actually uses, not design view.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    As already stated, Union queries and non-equi joins can't be displayed in design view.
    Nor can passthrough queries or data definition queries.

    Unless I've forgotten something, all the many other query types can be done in either design view or SQL view
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    168
    I think my question was really just....

    Do all queries that can only be done in SQL view show up with a special Icon, Like the union query does.
    (or is union the only query that cant be done in design view)

  6. #6
    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, append, update, delete, and passthrough queries all have different icons too.
    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. Replies: 7
    Last Post: 03-21-2018, 01:26 PM
  2. Tables Hidden
    By Andre Labuschagne in forum Access
    Replies: 12
    Last Post: 01-19-2017, 01:35 PM
  3. Hidden Controls
    By scsuflyboy in forum Forms
    Replies: 0
    Last Post: 03-17-2011, 02:20 PM
  4. Columns not being hidden
    By degras in forum Reports
    Replies: 3
    Last Post: 01-25-2011, 10:29 AM
  5. Replies: 0
    Last Post: 01-18-2011, 07:09 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