473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Sum of DateDiff in a report

As the title says, I'm trying to find the sum of a field I created in a report, which is for the difference in 2 times (in seconds). Here's what I'm trying:

=Sum(DateDiff("s",[ReviewStartTime],[ReviewStartTime]))

and it comes up as 0.

Is it because the field was created in the report and it's not an actual field on the table?

Is it possible to put a DateDiff as an actual field on the table and would that simplify things?

Thanks!

Jesse
Jul 15 '09 #1
8 4715
ChipR
1,287 Expert 1GB
You should create a query based on the table and add a field where you put the formula. The query builder will put Expr1: in front of the formula, and you should change the name of the field to something sensible. Then just base the report on the query.
Jul 15 '09 #2
Oh wow, you're the best.

Now that makes me formatting the time more difficult. I have it in seconds in the query, and in the report, I want to convert it to say something like "1hr 12min 4sec". I know I could do this within the query, but I'd like to keep it in seconds there, so I can sum and average times within the report.

I think this makes sense. Any ideas?
Jul 15 '09 #3
ChipR
1,287 Expert 1GB
The Format function can sort-of do this.
Format (seconds / 86400, "hh:nn:ss")
Jul 15 '09 #4
missinglinq
3,532 Expert 2GB
Oh, come on people! Would you really expect

=Sum(DateDiff("s",[ReviewStartTime],[ReviewStartTime]))

to return anything but zero? Both arguments are the same field!

Welcome to Bytes!

Linq ;0)>
Jul 15 '09 #5
ChipR
1,287 Expert 1GB
Hah, good one spotting that Linq :)
I was thinking of trying to get the Sum of a calcuated field in a report, but that would be a blank rather than zero wouldn't it? At least the effort of making the query isn't wasted.
Jul 15 '09 #6
Doh! Good catch, but that wasn't the problem, anyways, because I had tried it a few times in a few places a few different ways, and I know it was written correctly just about every time except the time I made the post :(

But yes, the query worked great!

Guh, I'm so clueless when it comes to access, but I'm learning. I'll do a little more research on the couple other questions I have and see if I can figure them out myself.

Thanks again!
Jul 16 '09 #7
Everything figured out, thanks for the help!
Jul 16 '09 #8
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Jul 16 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: inamori | last post by:
I face that problems 07/01/2003 06/30/2006 ---------> it should be 3 01/01/2003 02/28/2005 --------->could i get 2 years and 2 months 01/01/2003 03/01/2005 ...
4
by: Paolo | last post by:
I am having some problem with a Year Function. I have form on which I have 4 field which indicate dates and an additional form which sums those dates: These are the fields: YEARS...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
6
by: kevinjwilson | last post by:
I am trying to get the date difference between two dates but I don't want the function to include weekends in the calculation. Does anyone have an idea on how to make this work?
1
by: Shawn Yates | last post by:
I have query which shows when employees clock in (long time) and clock out(long time). To find the total hours worked in hours and minutes I have another field on my query with the following: ...
5
by: VSS | last post by:
Hello, I am working with a Report and I have used the Datediff function to calculate between an open date and a closed date : =DateDiff("d",,) My problem is that not all cases are closed...
2
by: muddasirmunir | last post by:
i am using vb 6 , i had place two datepicker in form now i want to calcuate differcen of month in two date for this i used the function datediff i had try it withh many syntax but getting error...
2
7 of 9
by: 7 of 9 | last post by:
OK here is my code: Select Case DateDiff("D", Shipdt, Date) Case Is > 90 WTAge = "GT-90" Case Is > 60 WTAge = "61-90" Case Is > 30
9
by: Lebbsy | last post by:
On the database that I am developing, I have a date column and I would like to create a report that I would use to calculate the number of months between todays date and the Effective Date. I used...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.