Wrox Programmer Forums
| 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 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
  #1 (permalink)  
Old April 15th, 2008, 10:34 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calculating time

Hello,
I got stuck with calculation/rounding and converting numbers back to time
Maybe I was taking too complicated way to do so ...

I am trying to do some small helper to count the time for each employee / timecards calculator

I have a following table (for each employee one)
F1 = IN/OUT F2 = date F3 = time
IN 1/4/2008 8:53
OUT 1/4/2008 17:21
IN 2/4/2008 8:42
OUT 2/4/2008 16:44

I need to round the time first. There are different rules to round the time for IN and different for OUT.

IN - ROUND function - i do not have any problems with that
OUT - FLOOR function from MS excel, factor = 15 minutes

FLOOR - I did query, I separated hours from minutes using DatePart function and I did a module to define FLOOR as Floor = Int(X / Factor) * Factor
and I rounded the separated minutes using FLOOR

In my case I got:
   worked
hours minutes FLOOR
17 21 15
16 44 30

Now I need to get them back to hour format and I am having trouble to do so. I would like to see 17:15 or 16:30 in my case


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating a time difference SQLScott SQL Server 2005 11 October 25th, 2007 02:42 AM
calculating time differences vincee SQL Server 2000 6 January 24th, 2006 11:02 AM
Calculating Time elapsed on form load Brendan Bartley Access 0 June 21st, 2005 09:02 AM
Problems with" i=i+1" and calculating time tronnen XSLT 4 June 6th, 2005 04:17 PM
Missing time part while calculating the Delay happygv SQL Language 2 October 29th, 2003 11:57 PM





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