If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Probably easiest the save the first query. Then create another query that
operates on the first one. Depress the Total button on the toolbar, and you can Group By the aaa/bbb field, and Sum or Average the Minutes field. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "DeeNg" wrote in message ... Thank you for respond, it works very well, and....I am having about an avege, I have total cases column, and total time column, which fomula +[Minutes] example Cases Total aaa .10 bbb 030 =Count(*) =[Minutes]... and I don't know about fomula to put it in. I appreciate you help. Dee "Allen Browne" wrote: The minutes should only be negative if an event ends before it starts. If you are doing that to indicate an event the ends on the next day (e.g. starts 11pm and ends 1am the next day), you could add 1440 minutes to compensate for the change of date. Something like this: =IIf(DateDiff("n", [StartDateTime], [EndDateTime]) 0, DateDiff("n", [StartDateTime], [EndDateTime]) + 1440, DateDiff("n", [StartDateTime], [EndDateTime])) "DeeNguyen" wrote in message ... Good morning Allen, Thank you a million time for you help. It works, but the minutes turn to negative if it greater than 190 minutes. I appreciate you value time. DeeNguyen "Allen Browne" wrote: Try the expressions on the web page in the Control Source of the text box on your report. They start with "=". If they still error, then make sure the Name of this text box is not the same as the name of one of your fields. For example the calculated text box cannot be named Start_Time or End_Time. "Dee" wrote in message ... Hi, yes, they are in Date/Time type fields, and I did it work on query, it turn to minutes, and the report based on that query when I enter the formula=Minutes.... the result is Errors. I appreciate your help. Thank "Allen Browne" wrote: Are Start_Time and End_Time fields in a table? Are they Date/Time type fields? Try the link: it explains how to calculate the difference in the query. Once you have it working there, it will be very easy to sum that and display it on the report. We have no idea what is in your HoursAndMinutes() function. "Dee" wrote in message ... Thank you very much, but the result turn 00 when I instate "h" to "n", and another it give me the diff total. Actually I have a function name call HoursAndMinutes, the total just take off every 12 hours when it count more than 12, look like if the total is 26 hours it will take away 12 hours and 12 hours until it = 2hours, if less than 12 it ok 1:00 2:00 1:00 Iam ok but 8:00 8:00 9:00 the result is 1:00 and my expression is =HoursAndMinutes(Sum([End_Time])-([Start_Time])) Thank again for your time. "Allen Browne" wrote: DateDiff("h"...) gives you whole hours only, so 0:59 counts as zero. Try working in minutes: =Sum(DateDiff("n", [Start_Time], [End_Time])) If you need to see that as hours and minutes: =Str(Sum(DateDiff("n", [Start_Time], [End_Time])) \ 60) & Format(Sum(DateDiff("n", [Start_Time], [End_Time])) Mod 60, "\:00") Explanation of how that works: http://allenbrowne.com/casu-13.html "Dee" wrote in message ... I'm having a problem totaling the total hours of worked in my report please if you know i would appreciate your help. my total column such as 0:15 1:20 0:30 ____ and my sytax is=Sum(DateDiff("h",Start_Time,End_Time)) and it return to 0:00 on my report. The total column I created from query. Thank |
#12
|
|||
|
|||
this works: you need 2 values, starttime and endtime; then, elapsed
time=((hour(endtime)+minute(endtime)/60))-((hour(endtime)+minute(endtime)/60)). if endtime is earlier than starttime, i.e. a night shift starting at 10pm and ending at 6am, you then need to add 24 hours to get the elapsed time. "Dee" wrote: I'm having a problem totaling the total hours of worked in my report please if you know i would appreciate your help. my total column such as 0:15 1:20 0:30 ____ and my sytax is=Sum(DateDiff("h",Start_Time,End_Time)) and it return to 0:00 on my report. The total column I created from query. Thank |
#13
|
|||
|
|||
I am having a problem on the total column report . How can get the total on
the report if I used crosstab query and the crosstab query is minutes: DateDiff("n" , [startDateTime], [EndDateTime]) Thank "DeeNg" wrote: Good morning Allen, Thank you a million time for you help. It works, but the minutes turn to negative if it greater than 190 minutes. I appreciate you value time. DeeNguyen "Allen Browne" wrote: Try the expressions on the web page in the Control Source of the text box on your report. They start with "=". If they still error, then make sure the Name of this text box is not the same as the name of one of your fields. For example the calculated text box cannot be named Start_Time or End_Time. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Dee" wrote in message ... Hi, yes, they are in Date/Time type fields, and I did it work on query, it turn to minutes, and the report based on that query when I enter the formula=Minutes.... the result is Errors. I appreciate your help. Thank "Allen Browne" wrote: Are Start_Time and End_Time fields in a table? Are they Date/Time type fields? Try the link: it explains how to calculate the difference in the query. Once you have it working there, it will be very easy to sum that and display it on the report. We have no idea what is in your HoursAndMinutes() function. "Dee" wrote in message ... Thank you very much, but the result turn 00 when I instate "h" to "n", and another it give me the diff total. Actually I have a function name call HoursAndMinutes, the total just take off every 12 hours when it count more than 12, look like if the total is 26 hours it will take away 12 hours and 12 hours until it = 2hours, if less than 12 it ok 1:00 2:00 1:00 Iam ok but 8:00 8:00 9:00 the result is 1:00 and my expression is =HoursAndMinutes(Sum([End_Time])-([Start_Time])) Thank again for your time. "Allen Browne" wrote: DateDiff("h"...) gives you whole hours only, so 0:59 counts as zero. Try working in minutes: =Sum(DateDiff("n", [Start_Time], [End_Time])) If you need to see that as hours and minutes: =Str(Sum(DateDiff("n", [Start_Time], [End_Time])) \ 60) & Format(Sum(DateDiff("n", [Start_Time], [End_Time])) Mod 60, "\:00") Explanation of how that works: http://allenbrowne.com/casu-13.html "Dee" wrote in message ... I'm having a problem totaling the total hours of worked in my report please if you know i would appreciate your help. my total column such as 0:15 1:20 0:30 ____ and my sytax is=Sum(DateDiff("h",Start_Time,End_Time)) and it return to 0:00 on my report. The total column I created from query. Thank |
#14
|
|||
|
|||
If this is supposed to be the total for all the columns in the report, you
can add a total column to the crosstab itself. In a fresh column of the crosstab query, enter: Field: MyTotalateDiff("n" , [startDateTime], [EndDateTime]) Total: Sum Crosstab: Row Heading -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "DeeNg" wrote in message ... I am having a problem on the total column report . How can get the total on the report if I used crosstab query and the crosstab query is minutes: DateDiff("n" , [startDateTime], [EndDateTime]) |
#15
|
|||
|
|||
Thank you, but what do I do when I have this
on the report I used =[paper] \60 & format( [paper] Mod 60, "\:00") it give me the correct on column paper but when i instead of paper by Electronic on Electronic column it give me an errors. Thank you for your help. Total time in Electronic total time in paper errors .10 1:00 "Allen Browne" wrote: If this is supposed to be the total for all the columns in the report, you can add a total column to the crosstab itself. In a fresh column of the crosstab query, enter: Field: MyTotalateDiff("n" , [startDateTime], [EndDateTime]) Total: Sum Crosstab: Row Heading -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "DeeNg" wrote in message ... I am having a problem on the total column report . How can get the total on the report if I used crosstab query and the crosstab query is minutes: DateDiff("n" , [startDateTime], [EndDateTime]) |
#16
|
|||
|
|||
You will not be able to sum that expression in teh report, but if the query
has a field named "paper" which contains the number of minutes, you could place a text box in the Report Footer section and show the total by setting its Control Source to: =Sum([paper]) \60 & format( Sum([paper]) Mod 60, "\:00") -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "DeeNg" wrote in message ... Thank you, but what do I do when I have this on the report I used =[paper] \60 & format( [paper] Mod 60, "\:00") it give me the correct on column paper but when i instead of paper by Electronic on Electronic column it give me an errors. Thank you for your help. Total time in Electronic total time in paper errors .10 1:00 "Allen Browne" wrote: If this is supposed to be the total for all the columns in the report, you can add a total column to the crosstab itself. In a fresh column of the crosstab query, enter: Field: MyTotalateDiff("n" , [startDateTime], [EndDateTime]) Total: Sum Crosstab: Row Heading "DeeNg" wrote in message ... I am having a problem on the total column report . How can get the total on the report if I used crosstab query and the crosstab query is minutes: DateDiff("n" , [startDateTime], [EndDateTime]) |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Please Help! Ref Article ID 210504 | Telobamipada | New Users | 8 | May 9th, 2005 01:09 PM |
Calendar Question | Josh | General Discussion | 7 | March 28th, 2005 11:19 PM |
ambiguous outer joins | renwick | Running & Setting Up Queries | 3 | February 22nd, 2005 01:29 PM |
Use first record found in expression? | CASJAS | Running & Setting Up Queries | 17 | July 22nd, 2004 09:21 PM |
Outlook 2003 Terminal Server Time Zone issue | Robert Strom | Calendar | 2 | May 26th, 2004 10:50 PM |