Sum a calculated date/time field

G

Guest

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?
 
G

Guest

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.
 
G

Guest

--
Lucy


Duane Hookom said:
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 said:
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?


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!
 
G

Guest

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 said:
--
Lucy


Duane Hookom said:
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 said:
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?


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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top