Results 1 to 4 of 4
  1. #1
    dadaboss92 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    2

    running total time period

    Hi,

    My table t_activity has got:
    a foreign key key_project related to the project name
    a foreign key key_architect related to the architect name
    date
    period which is a combo list with AM and PM

    In my form i write the name of the architect who work on a project, the date and if it was during the AM or PM

    I would like to follow up the time spent on each project. To succeed i need a running total of the AM and PM period for each project according to the dates


    Exp:
    Projet1 david 15/05/2015 AM
    Projet1 david 15/05/2015 PM
    Projet1 david 16/05/2015 AM
    Projet1 david 16/05/2015 PM
    Projet1 david 17/05/2015 AM
    Projet1 david 17/05/2015 PM

    Projet2 david 18/05/2015 AM
    Projet2 jean 18/05/2015 AM
    Projet2 jean 18/05/2015 PM


    Projet2 jean 19/05/2015 AM
    Projet2 jean 19/05/2015 PM

    Cumul progressif
    Projet1 15/05/2015 2
    Projet1 16/05/2015 4
    Projet1 17/05/2015 6

    Projet2 18/05/2015 3
    Projet2 18/05/2015 5


    I tried many fonction as but none work:
    Expr1: DSum("[period]","t_activity","[date]='" & [date] & "'")
    Expr1: DSum("[period]","t_activity Query","[date]='" & [date] & "'")
    Expr1: DSum("[Countofperiod]","t_activity","[date]='" & [date] & "'")
    Expr1: DSum("[Countofperiod]","t_activity Query","[date]='" & [date] & "'")
    Expr1: DSum("[period]","t_activity","[date]=#"&[date]&"#")
    Expr1: DSum("[period]","t_activity Query","[date]=#"&[date]&"#")
    Expr1: DSum("[CountOfperiod]","t_activity","[date]=#"&[date]&"#")
    Expr1: DSum("[CountOfperiod]","t_activity Query","[date]=#"&[date]&"#")


    Expr1: Dcount("[CountOfperiod]","t_activity Query","[date]=#"&[date]&"#")
    Expr1: Dcount("[CountOfperiod]","t_activity","[date]=#"&[date]&"#")
    Expr1: Dcount("[period]","t_activity Query","[date]=#"&[date]&"#")
    Expr1: Dcount("[period]","t_activity","[date]=#"&[date]&"#")
    Expr1: Dcount("[Countofperiod]","t_activity Query","[date]='" & [date] & "'")
    Expr1: Dcount("[Countofperiod]","t_activity","[date]='" & [date] & "'")
    Expr1: Dcount("[period]","t_activity Query","[date]='" & [date] & "'")
    Expr1: Dcount("[period]","t_activity","[date]='" & [date] & "'")




    Expr1: DCount("[key_architect]","[t_activity]","[key_Project]=""" & [key_Project] & """ AND [Date]<=#" & Format([Date],'mm/dd/yyyy') & "#")
    Expr1: DCount("[key_architect]","[t_activity]","[key_Project]=""" & [key_Project] & """ AND [Dateexec]<=#" & Format([Dateexec],'yyyy/mm/dd') & "#")
    Expr1: DCount("[key_architect]","[t_activity]","[key_Project]=""" & [key_Project] & """ AND [Date]<=#" & Format([Date],'yyyy/mm/dd') & "#")

    I give you some screen shots alsoClick image for larger version. 

Name:	Screenshot 2015-05-22 09.41.08.png 
Views:	10 
Size:	114.4 KB 
ID:	20801Click image for larger version. 

Name:	Screenshot 2015-05-22 09.41.22.png 
Views:	10 
Size:	121.0 KB 
ID:	20802Click image for larger version. 

Name:	Screenshot 2015-05-22 09.42.54.png 
Views:	10 
Size:	109.7 KB 
ID:	20803Click image for larger version. 

Name:	Screenshot 2015-05-22 09.43.03.png 
Views:	9 
Size:	106.7 KB 
ID:	20804

    Thank you in advance

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Running total is not easy to do in form or query. Textbox on report has a RunningSum property so is easy on report.

    Do you need a running total or do you need a total count of periods for each date on each project?

    SELECT Project, [date], Count(Period) AS CountPer FROM t_activity GROUP BY Project, [date];

    Is the date field a date/time type, not text?

    DCount("[period]","t_activity","[date]=#" & [date] & "# AND Project='" & [Project] & "'")


    Date is a reserved word and should not use reserved words as names.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dadaboss92 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    2
    Thank you for your reply but it doesn't work.

    It is essential for me to have the running total per date and per project in order to do a graph. I need data to make it (running total = axis y) & (date = axis y).

    If there is another solution or idea, even to add or modify my table i am ok.

    Thank you




    Quote Originally Posted by June7 View Post
    Running total is not easy to do in form or query. Textbox on report has a RunningSum property so is easy on report.

    Do you need a running total or do you need a total count of periods for each date on each project?

    SELECT Project, [date], Count(Period) AS CountPer FROM t_activity GROUP BY Project, [date];

    Is the date field a date/time type, not text?

    DCount("[period]","t_activity","[date]=#" & [date] & "# AND Project='" & [Project] & "'")


    Date is a reserved word and should not use reserved words as names.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    "Doesn't work" means the query runs without error but doesn't provide the output you want?

    Bing: Access query running total

    Review: https://support.microsoft.com/en-us/kb/290136
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Counting weeks within a time period
    By Nenadd in forum Queries
    Replies: 1
    Last Post: 10-29-2014, 06:32 AM
  2. Replies: 4
    Last Post: 10-10-2014, 02:39 PM
  3. Total Weeks and Concatenate Period Dates
    By mabuhay87 in forum Queries
    Replies: 4
    Last Post: 02-09-2014, 07:29 PM
  4. How do I store a period of time
    By OscarCat in forum Access
    Replies: 2
    Last Post: 06-10-2012, 05:08 PM
  5. Set Database to Expire in time period
    By robsworld78 in forum Access
    Replies: 12
    Last Post: 06-07-2011, 06:54 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