Results 1 to 6 of 6
  1. #1
    seth.murphine is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    charlotte nc
    Posts
    26

    Question Append query not working

    I have query 1 with the following sql:



    Code:
    SELECT yp_adv_data.ID, yp_adv_data.adQCC, yp_adv_data.adSalesD, Count(yp_adv_data.adQCC) AS CountOfadQCC
    FROM yp_adv_data
    GROUP BY yp_adv_data.ID, yp_adv_data.adQCC, yp_adv_data.adSalesD
    HAVING (((yp_adv_data.adQCC)=False) AND ((yp_adv_data.adSalesD) Is Not Null));
    Then query 2 with the following sql:

    Code:
    SELECT yp_adv_data.ID, yp_adv_data.adQCDate, Count(yp_adv_data.adQCC) AS CountOfadQCC
    FROM yp_adv_data
    GROUP BY yp_adv_data.ID, yp_adv_data.adQCDate
    HAVING (((yp_adv_data.adQCDate) Between Date() And Date()-6) AND ((Count(yp_adv_data.adQCC))=True));
    With an append query pulling the information from both queries to another table:

    Code:
    INSERT INTO yp_qc ( qc_comp, qc_open )
    SELECT Sum(qc_comp.CountOfadQCC) AS SumOfCountOfadQCC, Sum(qc_open.CountOfadQCC) AS SumOfCountOfadQCC1
    FROM qc_comp, qc_open;
    If there is an easier way I am all ears, but as of right now I am getting a new record in yp_qc. The fields are blank though, it is not pulling any data.
    Last edited by June7; 04-20-2012 at 01:26 PM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    All looks reasonable. Do you want to provide project for analysis? Follow instructions at bottom of my post.
    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
    seth.murphine is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    charlotte nc
    Posts
    26
    Sorry about that, ok I think since the last time you saw this thing... it has grown some type of life because I feel like there is a lot going on in it.

    Any other advice outside of this query question will not fall on def ears, but again thanks for looking at it.

    The append query should be under "QC Open/Complete Report"

    Impact1.zip

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    I can't extract the file - get 'unknown compression format' error. I can open only Windows Compression zip file.

    BTW, changed thread name to something more meaningful.
    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
    seth.murphine is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    charlotte nc
    Posts
    26

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    That was a learning experience.

    Couldn't get multiple SELECT to work but DSum does:

    INSERT INTO yp_qc ( qc_open, qc_comp ) Values(DSum("CountOfadQCC","qc_open"), DSum("CountOfAdQCC","qc_comp"));

    Think your qc_comp query might need some edits:
    SELECT yp_adv_data.ID, yp_adv_data.adQCDate, Count(yp_adv_data.adQCC) AS CountOfadQCC, yp_adv_data.adQCC
    FROM yp_adv_data
    GROUP BY yp_adv_data.ID, yp_adv_data.adQCDate, yp_adv_data.adQCC
    HAVING (((yp_adv_data.adQCC)=True));
    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. Help please! iif not working in query!
    By ham355 in forum Queries
    Replies: 4
    Last Post: 02-16-2012, 05:05 AM
  2. Can anyone see why this isnt working please?
    By shabbaranks in forum Programming
    Replies: 3
    Last Post: 12-23-2011, 03:19 AM
  3. IIF NULL not working
    By krutoigoga in forum Reports
    Replies: 6
    Last Post: 05-12-2010, 01:17 PM
  4. Working with PDF's
    By Mitch87 in forum Access
    Replies: 1
    Last Post: 02-19-2010, 11:24 AM
  5. Why isn't this working?
    By adiecidue in forum Queries
    Replies: 4
    Last Post: 04-27-2009, 10:29 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