Results 1 to 6 of 6
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Sum OF Two Fileds

    Hi

    Please see the screen shot below


    Click image for larger version. 

Name:	Untitled.jpg 
Views:	16 
Size:	29.1 KB 
ID:	34573

    Above is query that im running. is there is a way to get sum when two fields are equal. Ex: there are two F1's then i need the sum of total rate (42000) and leave the U1 as it is (16,800). Appreciate your help

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    select [Name], [LevelOfUnit] , sum([rate]) from table

  3. #3
    Join Date
    Apr 2017
    Posts
    1,792
    Code:
    SEELCT Unit_Name, SUM(TotalRate) AS Total_Rate FROM YourTable GROUP BY Unit_Name
    or
    Code:
    SEELCT Level_Of_Unit, SUM(TotalRate) AS Total_Rate FROM YourTable GROUP BY Level_Of_unit
    or
    Code:
    SEELCT Unit_Name, Level_Of_unit, SUM(TotalRate) AS Total_Rate FROM YourTable GROUP BY Unit_Name, Level_Of_unit

  4. #4
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    HI

    i tried above statement with Access Query but it give me below error

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	14 
Size:	14.4 KB 
ID:	34574

    Query Used: SELECT [LevelOfUnit],Sum([Rate]) FROM [Course]
    Is it possible to use a query name after From in sql.

    Something like
    SELECT [LevelOfUnit],Sum([Rate]) FROM [Query1]

  5. #5
    Join Date
    Apr 2017
    Posts
    1,792
    You can't have aggregate query without GROUP BY or HAVING clause.

  6. #6
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hi

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	8 
Size:	70.0 KB 
ID:	34583
    above is a report i created, i want the sum of (08:00+12:00) to shown is the Foundation filed, and the 3rd record to be shown in Diploma field. any suggestion how to do this part?

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

Similar Threads

  1. Combine fileds in Report
    By statue.919 in forum Reports
    Replies: 2
    Last Post: 08-01-2014, 02:31 AM
  2. Populate fileds off the last record
    By BorisGomel in forum Access
    Replies: 3
    Last Post: 11-09-2011, 11:37 AM
  3. Changin report's fileds with VBA
    By ser01 in forum Reports
    Replies: 4
    Last Post: 04-14-2011, 10:46 AM
  4. How to two same fileds on the same form
    By plavookins in forum Forms
    Replies: 1
    Last Post: 04-11-2011, 03:17 AM
  5. On format, fileds that can be used
    By markjkubicki in forum Reports
    Replies: 1
    Last Post: 10-22-2010, 10:56 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