Results 1 to 3 of 3
  1. #1
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84

    Sum Totals from query

    Need your help . I am stuck. The below is the SQL for my query. When i select in the form i need it to group by the (HD SKU)- "So only show the data once if there are multiples" and give me then sum up the (QTY) of that HD SKU










    SELECT [Material NSF_TBL_NSF_Data].[Building Number], [Material NSF_TBL_NSF_Data].[Unit Number], [Material NSF_TBL_NSF_Data].[Unit Type], [Material NSF_TBL_NSF_Data].[Scope'], [Material NSF_TBL_NSF_Data].[HD Sku], [Material NSF_TBL_NSF_Data].Description, [Material NSF_TBL_NSF_Data].Unit, [Material NSF_TBL_NSF_Data].Qty, [Material NSF_TBL_NSF_Data].xmcode, [Material NSF_TBL_NSF_Data].Phase, [Material NSF_TBL_NSF_Data].[Hand'], Sum([Total]) AS Expr1, *
    FROM [Material NSF_TBL_NSF_Data]
    WHERE ((([Material NSF_TBL_NSF_Data].[Building Number]) Like "*" & [forms]![Searchform]![Combo42]) AND (([Material NSF_TBL_NSF_Data].[Unit Number]) Like "*" & [forms]![Searchform]![Unit_Number]) AND (([Material NSF_TBL_NSF_Data].[Unit Type]) Like "*" & [forms]![Searchform]![Unit Type]) AND (([Material NSF_TBL_NSF_Data].[Scope']) Like "*" & [forms]![Searchform]![Scope]) AND (([Material NSF_TBL_NSF_Data].Phase) Like "*" & [forms]![Searchform]![Phase]) AND (([Material NSF_TBL_NSF_Data].[Hand']) Like "*" & [forms]![Searchform]![Hand]));

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    then you need 2 queries,
    Q1 to pull unique items
    Q2 to sum Q1.

  3. #3
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    Thank you

    Will i have to drop that Q1 data in a table then run a Q2 Sum because currently i am getting a this error message "Cannot Group on fields selected with "*" "

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

Similar Threads

  1. Query detail totals vs. Summary Totals do not match?
    By aellistechsupport in forum Queries
    Replies: 9
    Last Post: 01-15-2016, 11:36 AM
  2. Similar to totals and Grand totals
    By Thompyt in forum Reports
    Replies: 14
    Last Post: 01-24-2015, 06:39 PM
  3. Unusual Sub Totals & Totals in Groups.
    By Robeen in forum Reports
    Replies: 12
    Last Post: 03-20-2012, 08:55 AM
  4. Replies: 5
    Last Post: 12-06-2011, 11:18 AM
  5. Month totals and Year totals
    By marksnwv in forum Access
    Replies: 1
    Last Post: 08-05-2011, 10:13 AM

Tags for this Thread

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