A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum a calculated date/time field



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2007, 08:42 PM posted to microsoft.public.access.reports
Lucy
external usenet poster
 
Posts: 103
Default 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  
Old July 26th, 2007, 03:26 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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  
Old July 26th, 2007, 08:24 PM posted to microsoft.public.access.reports
Lucy
external usenet poster
 
Posts: 103
Default 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  
Old July 26th, 2007, 09:02 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.