PC Review


Reply
Thread Tools Rate Thread

Adding Minutes and Seconds

 
 
=?Utf-8?B?Rkw=?=
Guest
Posts: n/a
 
      1st Nov 2006
Any suggestions on adding mm:ss using Date/Time (Data Type) field. As an
example I have to add the following times. Note: these are run times and
obviously not clock times. The Date/Time field allows for hh:mm

44:22 (or 44 minutes and 22 seconds)
45:30 (or 45 minutes and 22 seconds)

Problem:
The Date/Time field allows for 23:59 maximum clock time. I'm able to
display these times using a text (Data Type) field but cannot add or average
multiple entries of these times (mm:ss).


--
FL
 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      1st Nov 2006
FL,

I think you mean nn:ss (mm is month).

Date/Time fields do support seconds. But for run times, it is better to
not try and use a Date/Time field.

One option is to have 2 separate Number (Integer) fields, one for the
minutes and the other for the seconds. You can set them up on a form so
it looks almost like you are entering them as an integrated entry if you
like. Then, to do your totals and everages, it is just a matter of a
calculation, for example a total might look like this...
Sum([RunMinutes])+Sum([RunSeconds])\60 & ":" & Sum([RunSeconds]) Mod 60

Alternatively, you could use the text field as you suggested, but then
to do your calculations you would need to extract the values, for example...
RunMinutes: Val(Left([YourTextField],InStr([YourTextField],":")-1))
RunSeconds: Val(Mid([YourTextField],InStr([YourTextField],":")+1))
or perhaps...
RunSeconds: Val(Right([YourTextField],2))

--
Steve Schapel, Microsoft Access MVP

FL wrote:
> Any suggestions on adding mm:ss using Date/Time (Data Type) field. As an
> example I have to add the following times. Note: these are run times and
> obviously not clock times. The Date/Time field allows for hh:mm
>
> 44:22 (or 44 minutes and 22 seconds)
> 45:30 (or 45 minutes and 22 seconds)
>
> Problem:
> The Date/Time field allows for 23:59 maximum clock time. I'm able to
> display these times using a text (Data Type) field but cannot add or average
> multiple entries of these times (mm:ss).
>
>

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      1st Nov 2006
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "ConvertStringStuff.mdb" which (among other things)
demonstrates how to add time values stored in text fields as strings to get
around this 24 hour limitation.
--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L


"FL" <(E-Mail Removed)> wrote in message
news:69DF5DEF-AF86-4EE2-BA85-(E-Mail Removed)...
> Any suggestions on adding mm:ss using Date/Time (Data Type) field. As an
> example I have to add the following times. Note: these are run times and
> obviously not clock times. The Date/Time field allows for hh:mm
>
> 44:22 (or 44 minutes and 22 seconds)
> 45:30 (or 45 minutes and 22 seconds)
>
> Problem:
> The Date/Time field allows for 23:59 maximum clock time. I'm able to
> display these times using a text (Data Type) field but cannot add or

average
> multiple entries of these times (mm:ss).
>
>
> --
> FL



 
Reply With Quote
 
=?Utf-8?B?Rkw=?=
Guest
Posts: n/a
 
      1st Nov 2006
Hi Steve,

Thanks for the reply. I think I'll try your 1st suggestion and try 2 number
fields. Will let you know if successful. Thanks!

Hi Rodger,

I'll check your website and let you know what helpful info. I find.

Thanks!
--
FL


"Steve Schapel" wrote:

> FL,
>
> I think you mean nn:ss (mm is month).
>
> Date/Time fields do support seconds. But for run times, it is better to
> not try and use a Date/Time field.
>
> One option is to have 2 separate Number (Integer) fields, one for the
> minutes and the other for the seconds. You can set them up on a form so
> it looks almost like you are entering them as an integrated entry if you
> like. Then, to do your totals and everages, it is just a matter of a
> calculation, for example a total might look like this...
> Sum([RunMinutes])+Sum([RunSeconds])\60 & ":" & Sum([RunSeconds]) Mod 60
>
> Alternatively, you could use the text field as you suggested, but then
> to do your calculations you would need to extract the values, for example...
> RunMinutes: Val(Left([YourTextField],InStr([YourTextField],":")-1))
> RunSeconds: Val(Mid([YourTextField],InStr([YourTextField],":")+1))
> or perhaps...
> RunSeconds: Val(Right([YourTextField],2))
>
> --
> Steve Schapel, Microsoft Access MVP
>
> FL wrote:
> > Any suggestions on adding mm:ss using Date/Time (Data Type) field. As an
> > example I have to add the following times. Note: these are run times and
> > obviously not clock times. The Date/Time field allows for hh:mm
> >
> > 44:22 (or 44 minutes and 22 seconds)
> > 45:30 (or 45 minutes and 22 seconds)
> >
> > Problem:
> > The Date/Time field allows for 23:59 maximum clock time. I'm able to
> > display these times using a text (Data Type) field but cannot add or average
> > multiple entries of these times (mm:ss).
> >
> >

>

 
Reply With Quote
 
=?Utf-8?B?Rkw=?=
Guest
Posts: n/a
 
      2nd Nov 2006
Hi Roger,

Reference message dated yesterday 11/1/2006.

The ConvertStringStuff.mdb does not work properly. It hangs up. Please try.

Hi Steve,

I could not get your 1st option to work. I used the following calculation
in the Control Source field of the Text Box
=Sum([MinutesFieldName])+Sum([SecondsFieldName])\60 & ":" &
Sum([econdsFieldName]) Mod 60

I'll try again today.
--
FL


"FL" wrote:

> Any suggestions on adding mm:ss using Date/Time (Data Type) field. As an
> example I have to add the following times. Note: these are run times and
> obviously not clock times. The Date/Time field allows for hh:mm
>
> 44:22 (or 44 minutes and 22 seconds)
> 45:30 (or 45 minutes and 22 seconds)
>
> Problem:
> The Date/Time field allows for 23:59 maximum clock time. I'm able to
> display these times using a text (Data Type) field but cannot add or average
> multiple entries of these times (mm:ss).
>
>
> --
> FL

 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      3rd Nov 2006
FL,

Works fine for me.

You seem to have a typo in "[econdsFieldName]".

Is this a textbox in the Footer section of the form?

I suppose you realise that you need to substitute [MinutesFieldName] and
[SecondsFieldName] for the actual names of these fields in your database.

--
Steve Schapel, Microsoft Access MVP

FL wrote:
> I could not get your 1st option to work. I used the following calculation
> in the Control Source field of the Text Box
> =Sum([MinutesFieldName])+Sum([SecondsFieldName])\60 & ":" &
> Sum([econdsFieldName]) Mod 60
>
> I'll try again today.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding minutes and seconds correctly =?Utf-8?B?VG9vc2g=?= Microsoft Excel Discussion 8 13th Sep 2006 09:29 AM
Adding hours minutes and seconds =?Utf-8?B?V2FubmFDaGV2eTAz?= Microsoft Excel Worksheet Functions 5 1st Feb 2006 02:42 PM
Adding minutes & seconds =?Utf-8?B?RW1pbHkxNg==?= Microsoft Excel Misc 5 13th Oct 2005 10:01 PM
adding together minutes and seconds robw Microsoft Excel Discussion 3 30th Apr 2004 09:40 PM
Adding up a column of minutes & seconds ann-marie Microsoft Excel Worksheet Functions 1 30th Sep 2003 08:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:47 AM.