Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2006, 05:45 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding Time Fields

Hi All
I have three fields in MS Access Database.The first is hours the second Minutes and the third is Seconds. I want to be able to add these fields and any carry over from seconds to minutes(Over 59 seconds)minutes carry over to hours
Thanks

Brendan Bartley
__________________
Brendan Bartley
 
Old July 27th, 2006, 12:49 PM
Authorized User
 
Join Date: Apr 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do something like:

HoursRevised=int(360*Hours+60*Minutes+Seconds)/360)
MinutesRevised=int((60*Minutes+Seconds)/60)
SecondsRevised=int((Seconds)/60)

Then replace hours with HoursRevised, Seconds with Seconds Revised, Minutes with Minutes Revised.

Or you could just maintain total seconds, and then populate the hours and minutes/seconds field with the integer method.

There might be a more elegant solution, but thats one I can think of off the top of my head.



 
Old July 28th, 2006, 10:33 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Trap
Where exactly do I use this code in a form or report and secondly do I use a text box for the result
Thanks

Brendan Bartley
 
Old July 30th, 2006, 08:35 PM
Authorized User
 
Join Date: Apr 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was thinking that you would just use the formulas in your query.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding fields to the crystal report Pravin.k Crystal Reports 2 January 3rd, 2008 09:35 AM
a problem with adding fields in ssems hassan1365 SQL Server 2005 2 June 6th, 2007 10:57 AM
Adding dynamic fields ivnavin Crystal Reports 0 December 17th, 2004 03:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.