Results 1 to 6 of 6
  1. #1
    flsticks is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Posts
    9

    Sums of Multiple Queries

    I have a table that contains a month of information
    EX: CSRID aaaaa
    wk1 "except"
    CSRID aaaaa
    wk2 "VQA"
    CSRID aaaaa
    wk3 "VQA"
    CSRID aaaaa
    wk4 "except"
    There are 300 records with different CSRID with information as above.
    I need to count by CSRID each "except" for the month and each "VQA" for the month. Because each CSRID will have various records in each week. I built queries by CSRID to count each week. Countwk1 "except" CSRID or Countwk1 CSRID "VQA" (all separate queries). I need to total by CSRID all each week count of "except" for the month. I tried to combing each query countwk1 and countwk2 (ect) to sum the countofwk1 (ect) for each CSRID. My result is incorrect. Anyone want to help with how I accomplish this task?
    Thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    could you possibly:

    *copy your actual table
    *sub fake data in for the first 5-10 records in the new table
    *post that fake table by copying and pasting all the data from access into a post here using the [ TABLE ] tags (all you need to do is select the entire table and copy it to the clipboard.)

    it would be much easier to read that way.

  3. #3
    flsticks is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Posts
    9

    sum of multiple queries

    thanks for taking a look
    QA_ASSIGNIDcsridFirstLastSupnameManagerQAwk1wk2wk3wk4SUPID1baconcoBaconCorinnaCumbie, JosephMelone, Teriwiser, kevinVQAExceptExceptVQAcumbijo2bakeareBakerArethaHall, KevinBraxton, KimberlyCorder, EmilyVQAVQAVQAVQAgrunker3blackdeBlackmonDemedraHall, KevinBraxton, Kimberlysamuels, vanessaVQAVQAVQAVQAgrunker4cameradCameronAdriaFulton, PertrinaBraxton, KimberlyOrfield, KennethVQAExceptExceptVQAfultope5clariallClaridgeAllanNeeley, LisaBraxton, KimberlyBerry, KellieVQAExceptExcept
    neeleli
    I have a query that counts wk1 and one the counts wk2 ect
    I want to do a query to look at the whole month per csrid

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I'm sorry sticks. that is very unreadable. it doesn't look like query SQL either. Please post what I mentioned and how I mentioned in my last post. You can read how to use tags here.

    You may be able to get some help from others here with that though...

  5. #5
    flsticks is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Posts
    9

    Sum of multiple queries

    Sorry trumpet wasn't paying good enough attention. Lets try this:
    CSRIDSUPIDQAIDwk1#WK1wk2#WK2wk3#wk3wk4#WK4SITEASSIGNMTHActiveallidejohncaorfikeVQA1VQA1VQA1VQA1TAMPAJUL2010FALSEaponjoholdstrodrhoVQA1VQA1VQA1VQA1TAMPAJUL2010FALSEarocroquinnerodrhoExcept1Except1Except1Except1TAMPAJul-10FALSEaveladhillbrhensgaExcept1Coach1Coach1Coach1TAMPAJUL2010FALSEbacocofostvesamuvaVQA1VQA1VQA1VQA1TAMPAJUL2010FALSE
    WK1 query: wk2 wk3 and wk4 are the same but using each week:
    SELECT:
    ASSIGNMENT.SITE, ASSIGNMENT.ASSIGNMTH, Count(ASSIGNMENT.wk1) AS CountOfwk1, ASSIGNMENT.wk1, EMPLOYEES.EMPID AS CSRID
    FROM
    EMPLOYEES LEFT JOIN ASSIGNMENT ON EMPLOYEES.EMPID = ASSIGNMENT.CSRID
    GROUP BY ASSIGNMENT.SITE, ASSIGNMENT.ASSIGNMTH, ASSIGNMENT.wk1, EMPLOYEES.EMPID
    HAVING (((ASSIGNMENT.wk1)="except"));
    SUM qry:
    SELECT
    ASSIGNMENT.CSRID, Exceptwk2.CountOfwk2 AS EXWK2, Exceptwk3.CountOfwk3 AS EXWK3, Exceptwk4.CountOfwk4 AS EXWK4, Exceptwk1.CountOfwk1 AS EXWK1, ASSIGNMENT.QAID, Sum([exwk1]+[exwk2]+[exwk3]+[exwk4]) AS TME
    FROM
    Exceptwk4 INNER JOIN (Exceptwk3 INNER JOIN (Exceptwk2 INNER JOIN (Exceptwk1 INNER JOIN ASSIGNMENT ON Exceptwk1.CSRID = ASSIGNMENT.CSRID) ON Exceptwk2.CSRID = ASSIGNMENT.CSRID) ON Exceptwk3.CSRID = ASSIGNMENT.CSRID) ON Exceptwk4.CSRID = ASSIGNMENT.CSRID
    GROUP BY ASSIGNMENT.CSRID, Exceptwk2.CountOfwk2, Exceptwk3.CountOfwk3, Exceptwk4.CountOfwk4, Exceptwk1.CountOfwk1, ASSIGNMENT.QAID;
    Last edited by flsticks; 09-16-2010 at 09:19 AM. Reason: wrong format

  6. #6
    flsticks is offline Novice
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Posts
    9
    I guess I am unable to format it correctly.
    Thanks for attempting to do it. I appreciate what you have done.

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

Similar Threads

  1. Sums in Detail area of report
    By Rick West in forum Reports
    Replies: 2
    Last Post: 12-01-2009, 07:15 PM
  2. Multiple database queries
    By G0zzy in forum Access
    Replies: 4
    Last Post: 08-28-2009, 12:06 PM
  3. Recordsource with Multiple queries
    By darshita in forum Programming
    Replies: 1
    Last Post: 08-10-2009, 03:17 PM
  4. Help writing multiple queries
    By wz72n01 in forum Queries
    Replies: 1
    Last Post: 05-24-2009, 12:30 PM
  5. calculating sums in reports
    By Hannu in forum Reports
    Replies: 1
    Last Post: 03-12-2009, 02:59 PM

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