473,774 Members | 2,206 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time grand total in MS-Access

I have a video tape library that we use at work here in a MS-Access
database.

When originally desgined, we never thought ot convert the time on the
fly into total seconds, but instead, we stored all of the times in
hh:nn:ss format - because that is the way we thought about things
around here, and which would make sense in our line of work.

Well, now I am being asked to run some statistics, and my boss wants
total time for created programming - meaning, he would like a sum of my
length field.

I have read some other postings saying to multiply my sum by 24.

Sum(length) * 24

However, I get a result of

370.69972222222 3

If I change the resulting format to hh:nn:ss, I get

16:47:36

Am I on the right track? Am I getting the correct result? HELP!?!

Jul 25 '06 #1
5 7130
si******@gmail. com wrote:
I have a video tape library that we use at work here in a MS-Access
database.

When originally desgined, we never thought ot convert the time on the
fly into total seconds, but instead, we stored all of the times in
hh:nn:ss format - because that is the way we thought about things
around here, and which would make sense in our line of work.

Well, now I am being asked to run some statistics, and my boss wants
total time for created programming - meaning, he would like a sum of my
length field.

I have read some other postings saying to multiply my sum by 24.

Sum(length) * 24

However, I get a result of

370.69972222222 3

If I change the resulting format to hh:nn:ss, I get

16:47:36

Am I on the right track? Am I getting the correct result? HELP!?!
Would the Second() function (see Help) work? This permits you to sum
the seconds.

Jul 25 '06 #2
si******@gmail. com wrote in
news:11******** **************@ m79g2000cwm.goo glegroups.com:
I have a video tape library that we use at work here in a
MS-Access database.

When originally desgined, we never thought ot convert the time
on the fly into total seconds, but instead, we stored all of
the times in hh:nn:ss format - because that is the way we
thought about things around here, and which would make sense
in our line of work.

Well, now I am being asked to run some statistics, and my boss
wants total time for created programming - meaning, he would
like a sum of my length field.

I have read some other postings saying to multiply my sum by
24.

Sum(length) * 24

However, I get a result of

370.69972222222 3

If I change the resulting format to hh:nn:ss, I get

16:47:36

Am I on the right track? Am I getting the correct result?
HELP!?!
I don't see any need for your output to be in days, so forget
the * 24..

About 2 years ago I created a pair of functions, sec2dur() and
dur2sec(), which convert the dd:hh:mm:ss format to seconds and
back again.

Feel free to modify it to suit your data.

Public function dur2sec( _
optional dd as integer = 0, _
optional hh as integer = 0, _
optional mm as integter= 0, _
optional ss as integer) as long

dur2sec = dd * 86400 + hh * 3600 + mm * 60 + ss

End Function


Public Function sec2dur(seconds As Long) As String
On Error Resume Next

Dim hrs As Long
Dim mins As Integer
Dim secs As Integer

hrs = Int(seconds / 3600)
mins = Int((seconds - (3600 * hrs)) / 60)
secs = seconds - (hrs * 3600 + mins * 60)

sec2dur = Format(hrs, "#,##0") & ":" _
& Format(mins, "00") & ":" _
& Format(secs, "00")

End Function

I originally wrote them to do a simulated EDL(1) in Access, so
they should be just what you want. convert your formatted
duration with seconds: dur2sec([fieldname]) in a query, sum the
seconds, then convert back with sec2dur([seconds]) .

(1) Edit Decision List. a database of each clip to be used in
creating a video program.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 25 '06 #3
Thank you for your quick replies. However, I should have indicated that
not noly am I complete novice, but I am also performing all of these
queries right in Access itself.

All I need is a grand total of the "length field" in one of my tables,
and it can be in hh:nn:ss format, but I guess that format is incapable
of giving me a total of 435:45:04, because it cuts off at 24 hours -
from what I have read...

That last posting threw me for a loop. Is there something I can do that
is a littl emore straight forward. All I need is a total.

Thank you all for the help!

Jul 26 '06 #4
"The House of Miguel" <si******@gmail .comwrote in
news:11******** **************@ p79g2000cwp.goo glegroups.com:
Thank you for your quick replies. However, I should have
indicated that not noly am I complete novice, but I am also
performing all of these queries right in Access itself.

All I need is a grand total of the "length field" in one of my
tables, and it can be in hh:nn:ss format, but I guess that
format is incapable of giving me a total of 435:45:04, because
it cuts off at 24 hours - from what I have read...

That last posting threw me for a loop. Is there something I
can do that is a littl emore straight forward. All I need is a
total.

Thank you all for the help!
you cannot get much more straightforward that the code posted and
still get the results you want.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 26 '06 #5
Bob Quintal wrote:
"The House of Miguel" <si******@gmail .comwrote in
news:11******** **************@ p79g2000cwp.goo glegroups.com:

>>Thank you for your quick replies. However, I should have
indicated that not noly am I complete novice, but I am also
performing all of these queries right in Access itself.

All I need is a grand total of the "length field" in one of my
tables, and it can be in hh:nn:ss format, but I guess that
format is incapable of giving me a total of 435:45:04, because
it cuts off at 24 hours - from what I have read...

That last posting threw me for a loop. Is there something I
can do that is a littl emore straight forward. All I need is a
total.

Thank you all for the help!

you cannot get much more straightforward that the code posted and
still get the results you want.

In a query, you can call a function like Bob's examples. If applying
within the query builder, enter something like
Expr1 : Sec2Dur(Seconds Amount)

Or you can use Dsum for a single value within some code
Dim strLen As String
Dim lngSecs As Long
'NZ used in case sum returns Null due to no finds
lngSecs = NZ(Dsum("Length ","TableName"," ID = 123"),0)
'convert the seconds value to a string
strLen = Sec2Dur(lngSecs )
...process further info

If you don't understand coding you might want to get a Microsoft
Step-By-Step book on the version of Access you are using.
Jul 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2437
by: Johannes Lebek | last post by:
Hi there, lately, I experienced a strange thing on my DB2 V8.1 on Windows: Some queries took a very long time. A snapshot discovered the following: Number of executions = 47 Number of compilations = 1 Worst preparation time (ms) = 2 Best preparation time (ms) = 2 Internal rows deleted = 0
3
3251
by: CSDunn | last post by:
Hello, I have 14 fields on a report that hold integer values. The field names use the following naming convention: T1Number, T2Number ....T14Number. I need to get a 'sub total' of all fields as follows: =Sum() ... =Sum() Then I need to get an average of all fields as follows:
4
2299
by: lyndsey | last post by:
i have a database to keep record of jobs in production, and on one of my forms, their is the control . in my form i have hundereds of records (jobs). is there a way i can create something in my record that will show me the grand total price of all the jobs in production. Thanks
6
4688
by: Coleen | last post by:
Hi All :-) Thanks for all of your help Cor :-) I can not get the code you sent me to work in my application. I'm using an aspx datagrid in a web form. I'm getting the following error message when I try this code: "Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier." Dim dr2 As DataRow = dt_stat_report_3b.NewRow Dim sum As Double =...
3
8239
by: rdudejr | last post by:
Hi all, Ive got a database approx 350 GB in which Im getting very high Time waited for prefetch. This is directly out of the snapshot for the db (these are for the entire database I assume as I pulled it out of get snapshot for all on {dbname}) Total buffer pool read time (milliseconds) = 45660639 Total buffer pool write time (milliseconds)= 42128058 Total elapsed asynchronous read time = 33856320
17
11231
by: barkarlo | last post by:
I need help to make grand total time in continuous forms. to calculate total work time I use following formula =format(+1--nz();"short time"). but when I make grand total time in form footer (for all records) my result is error. My grand total must be in format . thanks,
2
5077
by: sammiesue | last post by:
Hi, I have form with 2 autosummed textboxes ("total" and "casinototal"). I would like to have a grand total textbox ("grandtotal") get its value from summing "total" and "casinototal", but it doesn't seem to be working. Here is my code. Thanks for your help. -sammie <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Nursing Conference 2007 Registration Form</title>
1
1805
by: eogyamfi | last post by:
i have subreport within the main report. The grand total for the main report is showing on the report. The grandtotal for the subreport is not showing even though on the subreport itself it shows when it is run. Pls guide as to how to get the grand total of the subreport showing as part of the main report
3
3498
by: kkshansid | last post by:
how to get grand total of two years 2001,2002 are fields SELECT sum( 2001 ) AS "2001-2002", sum( 2002 ) AS "2002-2003", ( "2001-2002" + "2002-2003" ) AS "grand total" FROM school this query has error
2
3040
by: Bytesmiths | last post by:
I'm using GROUP BY to come up with totals for some items, but would like to either have a grand total at the bottom, or a running total field. I tried to use a variable as I found in several places on the web: SELECT @total := total + value AS `Running Total` but what I'm totalling is an aggregate, and it doesn't seem to work. I tried to explore some options dev.mysql.com, but again, my field seems to be too complex. More specifically,...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.