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 |
#1
|
|||
|
|||
Sum a calculated date/time field
When trying to sum the date time field I get a aggregate error that refers to
the first field in the query that has nothing to do with the calculated field. I am able to convert it into integer format and subtract two date fields to get the total time. But when I try to sum the total time I get the aggregate error refering to the first field in query. This is the calculation I use to get the field I would like to sum. It works great but can not figure out how to sum it without the aggregate error. Elapsed Time: Int(CSng(([actual completion time]-[actual start time])*24)) & ":" & Format([actual completion time]-[actual start time],"nn:ss") Can anyone help me? -- Lucy |
#2
|
|||
|
|||
Sum a calculated date/time field
It looks like the calculated column in your query is returning a string. Is
it left or right aligned when viewing in the datasheet? I would simply subtract the start from the end in the query and then perform the formatting in the report control. -- Duane Hookom Microsoft Access MVP "lucy" wrote: When trying to sum the date time field I get a aggregate error that refers to the first field in the query that has nothing to do with the calculated field. I am able to convert it into integer format and subtract two date fields to get the total time. But when I try to sum the total time I get the aggregate error refering to the first field in query. This is the calculation I use to get the field I would like to sum. It works great but can not figure out how to sum it without the aggregate error. Elapsed Time: Int(CSng(([actual completion time]-[actual start time])*24)) & ":" & Format([actual completion time]-[actual start time],"nn:ss") Can anyone help me? -- Lucy |
#3
|
|||
|
|||
Sum a calculated date/time field
-- Lucy "Duane Hookom" wrote: It looks like the calculated column in your query is returning a string. Is it left or right aligned when viewing in the datasheet? I would simply subtract the start from the end in the query and then perform the formatting in the report control. -- Duane Hookom Microsoft Access MVP "lucy" wrote: When trying to sum the date time field I get a aggregate error that refers to the first field in the query that has nothing to do with the calculated field. I am able to convert it into integer format and subtract two date fields to get the total time. But when I try to sum the total time I get the aggregate error refering to the first field in query. This is the calculation I use to get the field I would like to sum. It works great but can not figure out how to sum it without the aggregate error. Elapsed Time: Int(CSng(([actual completion time]-[actual start time])*24)) & ":" & Format([actual completion time]-[actual start time],"nn:ss") Can anyone help me? -- Lucy I tried this formula- TOTAL: Sum(([actual completion time]-[actual start time])*24), and I still get a this message. "You tried to execute a query that does not include the specified expression 'RESPONSEDAYS' as part of an aggregate function. 'RESPONSEDAYS' is the first field used in the query but has no calculations being done to it in the query. Nor should it have any. I am stumped by this error as it refers to a field I am not using to try and sum. Please help me! |
#4
|
|||
|
|||
Sum a calculated date/time field
It looks like you are still attempting to format and/or sum in your query. As
stated earlier, I would not do this. Applying formats should be done in control on your report and aggregating should be done in group or report headers or footers. -- Duane Hookom Microsoft Access MVP "lucy" wrote: -- Lucy "Duane Hookom" wrote: It looks like the calculated column in your query is returning a string. Is it left or right aligned when viewing in the datasheet? I would simply subtract the start from the end in the query and then perform the formatting in the report control. -- Duane Hookom Microsoft Access MVP "lucy" wrote: When trying to sum the date time field I get a aggregate error that refers to the first field in the query that has nothing to do with the calculated field. I am able to convert it into integer format and subtract two date fields to get the total time. But when I try to sum the total time I get the aggregate error refering to the first field in query. This is the calculation I use to get the field I would like to sum. It works great but can not figure out how to sum it without the aggregate error. Elapsed Time: Int(CSng(([actual completion time]-[actual start time])*24)) & ":" & Format([actual completion time]-[actual start time],"nn:ss") Can anyone help me? -- Lucy I tried this formula- TOTAL: Sum(([actual completion time]-[actual start time])*24), and I still get a this message. "You tried to execute a query that does not include the specified expression 'RESPONSEDAYS' as part of an aggregate function. 'RESPONSEDAYS' is the first field used in the query but has no calculations being done to it in the query. Nor should it have any. I am stumped by this error as it refers to a field I am not using to try and sum. Please help me! |
Thread Tools | |
Display Modes | |
|
|