473,387 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Time Problems

Hello,

Working on a database at work...unfortunatly I can't redesign the
source data like I'd want it.

I have to work out the hours a driver has worked from date, start time
and finish time. This is great if he does 9am - 5pm however if he goes
over 00:00 and finishes in the morning then it fails to work it out.

At the moment I have:

=IIf([Start Work]>[Finish Work],(([ValMidnight]-[Start Work])+[Finish
Work])*24,(([Finish Work]-[Start Work])-[Total Breaks])*24)

The val midnight is a text box I have hidden with 23:59:59 as a time in
there to simulate midnight so working out everything to midnight and
then what was worked over. This however produces #Error when put into a
report.

Any ideas?

Cheers
Richard

Jun 26 '06 #1
2 1248
Sorted it now.

For reference I used:

Hours Worked: IIf([Start Work]>[Finish
Work],(TimeValue("23:59:59")-[Start Work])+[Finish
Work]+TimeValue("00:00:01"),([Finish Work]-[Start Work])-IIf([Total
Breaks]<>0,[Total Breaks],0))*24

The second TimeValue() is to make the rounding easier so that it is not
displaying .99999 of an hour.

Jun 26 '06 #2
Assuming [Start Work] and [Finish Work] are date fields and contain the date
worked why not use datediff("s",[Finish Work],[Start Work]) which will
return number of seconds.

"Sockpuppet" <ri*****@firebadger.net> wrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Sorted it now.

For reference I used:

Hours Worked: IIf([Start Work]>[Finish
Work],(TimeValue("23:59:59")-[Start Work])+[Finish
Work]+TimeValue("00:00:01"),([Finish Work]-[Start Work])-IIf([Total
Breaks]<>0,[Total Breaks],0))*24

The second TimeValue() is to make the rounding easier so that it is not
displaying .99999 of an hour.

Jun 26 '06 #3

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

Similar topics

11
by: Cameron Laird | last post by:
*The Chronicle of Higher Education*, which is more-or-less authoritative for US university administrations, is spon- soring a discussion on the place of open-source in universities ("... are such...
0
by: Eric S. Johansson | last post by:
more questions about performance measurements in python. I solve the problems I had with shelf by not using it. I'm doing a direct pickle to and from file of an entire dictionary. That knocked off...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
3
by: Benny | last post by:
Hi All, In an application I write, I need to have some mapping service, where I can select two locations, which shall calculate the distance and mainly the time(could be approximate) to travel...
17
by: Eric Lindsay | last post by:
Is learning to write CSS a better use of time than finding and using a package that produces complete web pages? I've moved to a new platform (Macintosh), taking with me about 400 personal web...
43
by: Mike MacSween | last post by:
Or something to do with Nulls in PK. Which is obviously wrong. OK, after a diversion of having to earn money its back to the free one. The orchestral management system. At the E-R level: An...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
6
by: dredge | last post by:
Hi, the server that hosts my PHP pages has its clock set to Greenwich Mean Time (GMT timezone 0). I need for my PHP scripts to have access to my local time which is Central Standard Time in the...
5
by: Charles May | last post by:
Anyone have a simple concept for the best way to store timeclock information in a database. I currently have my table set up like this with a typical daily entry. tcID empID Type ...
27
by: CodeMonk3y | last post by:
gotta question on sizeof keyword does the sizeof keyword calcuates the size at compile time or run time ?? -- Posted on news://freenews.netfront.net - Complaints to news@netfront.net --
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.