Results 1 to 4 of 4
  1. #1
    skydivetom is online now VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046

    Try to mitigate need of a "helper" query

    Experts:

    I need some assistance with "streamlining" a query process. Attached is a sample database which contains one table and two queries (i.e, 1 SELECT query and 1 CROSSTAB query).

    Background:
    - In my actual database, I have 100+ queries. These were developed over the course of the last few months.
    - At this time, I'm performing some cleanup of my database and I'd like to reduce (where possible) the amount of queries (i.e., remove any "helper/input queries" as much as possible).

    Background on table T01_Staffmembers:
    - Field [All_Onboard] is Yes/No field. If checked, the staff member is onboard (i.e., "active"). If not checked, he/she is "inactive".
    - Field [All_Type] has values = "Officer", "Enlisted", "Civilian", and "Contractor"

    Process on my queries:
    - I use "Query1_Input" to get a simple count on the four "Types" (Officer, Enlisted, etc.) further broken down by onboard (either "active" or "inactive").
    - Next, I use "Query1_Input" as my source for the crosstab query ("Query2_Output").

    ... overall, this accounting works great and I get the correct results in my crosstab query.



    **However**, as mentioned in my opening sentence, I'm interested in "streamlining" my database. That is, quite often, I have to use a "helper/input" query to get to my final results. So, in this case, I end up w/ two (2) queries to get my final result (illustrated in the crosstab qry).

    My question: Is there any way I get mitigate the use of the input/helper query and get the same results of the cross-tab query via a single query? If so, what would that query look like?

    EEH
    Attached Files Attached Files

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    You don't need a helper query in this case, have a look at the updated file.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    skydivetom is online now VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Gicu -- absolutely brilliant! Thank you so much for your help... very much appreciated.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    You're very welcome, good luck with your streamlining!
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Simple table relationships ("faces" to "spaces" to "chairs")
    By skydivetom in forum Database Design
    Replies: 36
    Last Post: 07-20-2019, 01:49 PM
  2. Replies: 3
    Last Post: 06-06-2018, 08:26 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 1
    Last Post: 07-10-2015, 06:33 AM
  5. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 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