Results 1 to 2 of 2
  1. #1
    mrfixit1170 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    42

    Trouble with suming, grouping records

    Hello All,


    I am looking for alittle assistance concerning a totals query. I have 2 tables I would like to get totals grouped by EI_ID. My tables are:

    Code:
    SD
    EI_ID
    Event_Date
    EVENT_No
    SYS_Code
    IETM_ID
    Code:
    SV
    IETM_ID
    MFID
    MOSID
    QTY
    [TIME]
    My query is:
    Code:
    SELECT SD.EI_ID, SV.MOS_ID, (SV.Quantity*SV.[TIME]) AS SDMH
    FROM tbl_AVUM_Scored_Data AS SD INNER JOIN tbl_List_SiteVisit2 AS SV ON SD.IETM_ID = SV.IETM_ID
    out put looks like this

    EI_ID MOS_ID SDMH
    AH0640 15R .8
    AH0351 15G .9
    AH0318 15R .3
    AH0640 15Y 1.4





    I am trying to get a list grouped by EI_ID and MOS_ID with totals of the SDMH by MOS_ID.....
    I am stuck at the suming of the SDMH by MOS and Grouping by EI_ID
    I'd like to get to this:

    EI_ID MOS_ID SDMH
    AH0640 15R 24.0
    XXXXXX 15Y 8.0
    AH0351 15G 5.0
    XXXXXX 15T 360.0

    Any Help will be much appreciated!

  2. #2
    mrfixit1170 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    42
    I guess I had a brain fart sorry for the waste of time....
    My code
    Code:
     
    SELECT sd.EI_ID, sv.MOS_ID, Sum([sv].[Quantity]*[sv].[Time]) AS SDMH
    FROM dbo_tbl_AVUM_Scored_Data AS sd INNER JOIN dbo_tbl_List_SiteVisit2 AS sv ON sd.IETM_ID = sv.IETM_ID
    GROUP BY sd.EI_ID, sv.MOS_ID;

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

Similar Threads

  1. Replies: 4
    Last Post: 01-04-2012, 02:35 PM
  2. Query by time while suming another column
    By abodi in forum Queries
    Replies: 2
    Last Post: 09-28-2011, 07:56 PM
  3. Replies: 3
    Last Post: 09-01-2011, 11:07 PM
  4. Replies: 1
    Last Post: 02-16-2011, 09:08 AM
  5. Suming Positive Numbers Only
    By jbarrum in forum Access
    Replies: 5
    Last Post: 04-24-2009, 03:51 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