Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 25th, 2006, 05:45 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #2 (permalink)  
Old July 27th, 2006, 12:49 PM
Authorized User
 
Join Date: Apr 2006
Location: , , .
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.



Reply With Quote
  #3 (permalink)  
Old July 28th, 2006, 10:33 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
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
Reply With Quote
  #4 (permalink)  
Old July 30th, 2006, 08:35 PM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


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



All times are GMT -4. The time now is 08:44 AM.


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