Results 1 to 6 of 6
  1. #1
    adhossain is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    5

    Addition according to ID

    Hi, I've a access table like below



    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	9.9 KB 
ID:	19660

    I want to make a query which will first findout the duration of time by "Starting-Ending" and then add the result according to ID. For example below
    Click image for larger version. 

Name:	q.PNG 
Views:	9 
Size:	1.5 KB 
ID:	19661
    Attached Thumbnails Attached Thumbnails Capture.PNG  

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    This may get you started.
    Create the following query:
    Code:
    SELECT tblTable.ID, (DateDiff("n",[t1],[t2]))/60 AS difFROM tblTable
    GROUP BY tblTable.ID, tblTable.t1, tblTable.t2;
    Then create the following query:
    Code:
    SELECT FirstQry.ID, Sum(FirstQry.dif) AS durationFROM FirstQry
    GROUP BY FirstQry.ID;
    The second query should give the required result but is not formatted to show result as 00:00
    Also, pretty sure this could be done in one query using the first query a sub query within the second but that is not my strong suit.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    adhossain is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    5
    Quote Originally Posted by Bob Fitz View Post
    This may get you started.
    Create the following query:
    Code:
    SELECT tblTable.ID, (DateDiff("n",[t1],[t2]))/60 AS difFROM tblTable
    GROUP BY tblTable.ID, tblTable.t1, tblTable.t2;
    Then create the following query:
    Code:
    SELECT FirstQry.ID, Sum(FirstQry.dif) AS durationFROM FirstQry
    GROUP BY FirstQry.ID;
    The second query should give the required result but is not formatted to show result as 00:00
    Also, pretty sure this could be done in one query using the first query a sub query within the second but that is not my strong suit.
    Hi Bob,
    Thank u very much for ur kind information. I may come to u again for finding solution

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Thank u very much for ur kind information. I may come to u again for finding solution
    Please do. We are always glad to help if we can.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    adhossain is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    5
    Quote Originally Posted by Bob Fitz View Post
    Please do. We are always glad to help if we can.
    Hi Bob,
    I'm really novice in MS Access. I'm attaching here my database. I have putted some text boxes and labels in the Report. I need to figure out those information like total training, total time, total participants, sex ratio (Please see attachment).
    But the report needs to be produced according to the time period of "tblTime.Date" and "lstTimePeriod" of report named "rptMain"
    I know it might not possible for u to provide in depth solution of this. But it would be really helpful for me if u could guide me on this.

    M&E_DB.mdbM&E_DB.mdb

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Well to start with your report has no Record Source
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Addition With 0's
    By jo15765 in forum Queries
    Replies: 8
    Last Post: 07-12-2013, 11:11 AM
  2. parsing for addition
    By imintrouble in forum Reports
    Replies: 6
    Last Post: 10-27-2011, 03:00 PM
  3. Combo box-Selective addition
    By reidn in forum Forms
    Replies: 1
    Last Post: 07-20-2011, 11:44 AM
  4. Getting #Number ! on addition of 5 textbox
    By Grooz13 in forum Forms
    Replies: 0
    Last Post: 08-18-2010, 07:49 AM
  5. addition with 0
    By Peljo in forum Access
    Replies: 0
    Last Post: 02-28-2008, 08:12 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