473,399 Members | 3,401 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,399 software developers and data experts.

Over 80 hours.

This is references to the post # 11 of the following thread..

Click link to view entire thread:

http://groups.google.com/group/comp....rum2001&hl=en&

-----------------------------------------------------------------------------------------------
Is there anyway to make it like the following. If there is
overtime, then have Regular Time display = 80:00:00
If under 80:00:00, then display the correct hours
I could not get the original messages back via my ISP Google.
Anyway, It's just a matter of building up the calculations and
nesting them in IIF statements.

so if you have TotalTime (in seconds)
RegularTime is
iif(TotalTime 80*60*60,80*60*60,Totaltime).

OverTime is
iif(TotalTime 80*60*60,totaltime-80*60*60,0).

Those would go inside the SecToDur() function that I originally
provided in 2004

Public Function sec2dur(seconds As Long) As String
On Error Resume Next
Dim hrs As Long
Dim mins As Integer
Dim secs As Integer
hrs = Int(seconds / 3600)
mins = Int((seconds - (3600 * hrs)) / 60)
secs = seconds - (hrs * 3600 + mins * 60)
sec2dur = Format(hrs, "#,##0") & ":" & Format(mins, "00") & ":"
&
Format(secs, "00")
End Function

- Hide quoted text -
- Show quoted text -

------------------------------------------------------------------------------------------------------------------------
Where exactly would I put the following lines in the sec2dur?

iif(TotalTime 80*60*60,80*60*60,Totaltime).

OverTime is
iif(TotalTime 80*60*60,totaltime-80*60*60,0).

I keep getting coding errors when I paste them.

Thanks!

Jul 11 '06 #1
1 1476
I would imagine that you'd have a summary query to gather the total
hours across several records, right? Then use a totals query to get
total time (in minutes).
Then if you divide by 60, you get hours. Then once you have that in
your totals query, you can base another query on the totals query.

RegularHrs: IIF(TotalHours>=40,40,TotalHours)
OT: IIF(TotalHours>40,TotalHours-40,0)

Jul 12 '06 #2

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

Similar topics

10
by: Drum2001 | last post by:
I have designed a "Time Tracker Database"... Basically a Time Clock. I have report that calculates the number of regular hours worked per week. Currently I am running the following query: ...
3
by: vicyankees | last post by:
I am creating a report that has call duration and if i run it over a multi-day span the duration is limited to 24 hours and starts over at zero. is there a way to not limit hours? I am usign...
22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
3
by: jbosrock | last post by:
Hi to all, Please bear with me as I am newly experienced in basic Access 2003 only. I don't know Visual Basic or macros at all but am attempting to learn on my own. Explanation: Our fleet...
4
by: NormAmst | last post by:
I have a list of CPU processing times and job durations for an entire department at work. There are 3 classifications I am maintaining. CPU time during peak hours , CPU time during non peak hours...
17
by: Grant Kelly | last post by:
I'm wondering if it's possible within HTML markup (or possibly CSS) to specify that an HTML table's headers should be placed 'over' the cell borders rather than 'within' the cells. For example...
2
by: =?Utf-8?B?RG91Zw==?= | last post by:
Automatic Update has started installing XP SP3 on my Dell P4-2800 running XP Home. It has been at the same point "Finishing Installation" with details of "Running Processes after install" for over...
4
by: Brian | last post by:
I have a 2000/2002 Access db that I use to collect and store my exercisetime using a form to enter. I wanted to see a summary of the total timefor each exercise so I have a subform that does this....
0
by: Massimiliano Campagnoli | last post by:
Hy All, is there a library in C++ supporting datetime arithmetic over a given business calendar. For instance, a typical 8 hours shift in a company is from 8am to 12am and from 1:30pm to 5:30pm...
4
by: julia2009 | last post by:
Please help! I have a db that is a time tracker. When I try to get the total hours and minutes and it is over 23:59 it is not working. If someone could please advise I would be very thankful.
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.