473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calculating Overtime over a Range.

106 New Member
I have a database where order numbers are entered by a group of 25 users. The Access database is split. As each order number is entered, a time stamp using a general format is used on the table. Now, I have first been asked to generate a report based on production over time. That's fine. I can do a sql query using > and < in the where section (because it shows hours minutes and seconds, I use this ) Now, my bosses want reports where they can choose a start date/time and an ending date/ time for a specific time frame. for example, they would like a report for Monday, September 10 to Tuesday, September 19 but only for the period of 6:00AM to 8:00AM only, with totals. I don't know how to go about it.

Any help is appreciated

Richard
Sep 19 '07 #1
6 2043
Scott Price
1,384 Recognized Expert Top Contributor
I have a database where order numbers are entered by a group of 25 users. The Access database is split. As each order number is entered, a time stamp using a general format is used on the table. Now, I have first been asked to generate a report based on production over time. That's fine. I can do a sql query using > and < in the where section (because it shows hours minutes and seconds, I use this ) Now, my bosses want reports where they can choose a start date/time and an ending date/ time for a specific time frame. for example, they would like a report for Monday, September 10 to Tuesday, September 19 but only for the period of 6:00AM to 8:00AM only, with totals. I don't know how to go about it.

Any help is appreciated

Richard
Is that a period of 6:00AM to 8:00AM each day?

Write up a quick sql query using your dates and including the fields you want to total (and you'll likely need >=, and <= on the date fields to get the right results) and post back with the sql code (please also wrap this in the code tags by selecting the sql text and clicking # at the top of this reply window, then manually edit the first tag to look just like this: [code=sql] )

Thanks!

Regards,
Scott
Sep 20 '07 #2
Rickster66
106 New Member
Hi Scott, Here is the sql statement, note that this statement is only for one day, I need to be able to select a range, say a week.

Expand|Select|Wrap|Line Numbers
  1. SELECT queues_members.members_id, queues_members.username, queues_members.initials, queues_members.queue, queues_members.cell, queues_members.status, Count(queues_members.BIB) AS BIB, Count(queues_members.BIBr) AS BIBr, Count(queues_members.MRD) AS MRD, Count(queues_members.PT) AS PT, Count(queues_members.DE) AS DE, Count(queues_members.DEr) AS DEr, Count(queues_members.WF) AS WF, Format([date],"m/d/yyyy") AS datet
  2. FROM queues_members
  3. WHERE (((queues_members.date)>=#8/16/2007 5:30:10 AM# And (queues_members.date)<=#8/16/2007 8:2:10 AM#))
  4. GROUP BY queues_members.members_id, queues_members.username, queues_members.initials, queues_members.queue, queues_members.cell, queues_members.status, Format([date],"m/d/yyyy");
  5.  
Thanks, Richard

Is that a period of 6:00AM to 8:00AM each day?

Write up a quick sql query using your dates and including the fields you want to total (and you'll likely need >=, and <= on the date fields to get the right results) and post back with the sql code (please also wrap this in the code tags by selecting the sql text and clicking # at the top of this reply window, then manually edit the first tag to look just like this: [code=sql] )

Thanks!

Regards,
Scott
Sep 20 '07 #3
Scott Price
1,384 Recognized Expert Top Contributor
What you will need to do is separate out the date and time sections from your queues_members.date field into two separate fields. It's a good idea to rename your field something other than Date also, since this is a reserved word in Access/VBA. Then you can run a simple parameter through for the date range, and do the same with the time range as well.

I suggest something like MemWorkDate for the date, and MemWorkTime for the time field.

You can right-click on the query window and choose Parameters. Place four parameters: [Start Date], [End Date], [Start Time], [End Time] all with data types of Date/Time.

Back in the query design grid, in the criteria for your MemWorkDate type in Between [Start Date] And [End Date], and in the criteria for you MemWorkTime: Between [Start Time] And [End Time].

This will pop up the parameter windows to prompt you to enter the date range you want, as well as the time range you want.

Regards,
Scott
Sep 20 '07 #4
Rickster66
106 New Member
Thanks Scott, I will try it out.


What you will need to do is separate out the date and time sections from your queues_members.date field into two separate fields. It's a good idea to rename your field something other than Date also, since this is a reserved word in Access/VBA. Then you can run a simple parameter through for the date range, and do the same with the time range as well.

I suggest something like MemWorkDate for the date, and MemWorkTime for the time field.

You can right-click on the query window and choose Parameters. Place four parameters: [Start Date], [End Date], [Start Time], [End Time] all with data types of Date/Time.

Back in the query design grid, in the criteria for your MemWorkDate type in Between [Start Date] And [End Date], and in the criteria for you MemWorkTime: Between [Start Time] And [End Time].

This will pop up the parameter windows to prompt you to enter the date range you want, as well as the time range you want.

Regards,
Scott
Sep 20 '07 #5
Rickster66
106 New Member
It works!

Thank You Scott!!
Sep 21 '07 #6
Scott Price
1,384 Recognized Expert Top Contributor
It works!

Thank You Scott!!
You're quite welcome! Pleased it's working for you...

Regards,
Scott
Sep 21 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5335
by: Eric Whittaker | last post by:
here's my dilemma, on the program below, i am trying to calculate overtime pay at time and a half, but instead of only counting the hours after 40, it counts all hrs at that rate, how can i avoid...
3
2426
by: Jamie Pittman via AccessMonster.com | last post by:
I am currently working on a project to take an employees time for a day and and if over 8 hours it would move those extra hours to overtime row amd not caculate into regular time. I started to use...
5
12969
by: Jamie Pittman via AccessMonster.com | last post by:
I have two tables with 5000 entries on them. One is based for regular time with several variables example (employee name, date,time in and out, code, customer, building) I have another table that...
3
2255
by: michb | last post by:
I need to be able to calculate on a daily basis, both normal and overtime hours for both payroll and job costing. I also then need to calculate the above on a weekly basis, in order to complete...
5
4146
by: Mr. Ken | last post by:
I am calculating the phase of an IQ signal, which are polluted by AWGN gaussian noise. Thus, near pi/2, direct division of atan(Q/I) may yield outputs either +pi/2 or -pi/2. How do I handle this...
1
2374
by: hakunamatata5254 | last post by:
Hi all, In my project of multiple forms (main form, subform1, 2 , 3 etc) (Main form is Employees, Subforms are Attendance, salary details, payment) Now i want to calculate the payment based...
3
2872
by: foxykitty | last post by:
Hi, How can I group in my qryMonthlyHours in SQL view by , and then sum done in that month? I have another query - qrySaturdayRota ,,,,, ALL THIS IS GROUPED EXCEPT FOR has a criteria...
5
4217
by: simchajoy2000 | last post by:
Hi, I need to calculate a range of colors given the beginning and ending colors in hex values (i.e. blue to red). I know there is a logic to hex numbers and there is probably a fairly simple...
25
4990
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for...
1
2459
cori25
by: cori25 | last post by:
Employee's input the shifts they want, once I have all this data I need to determine who will get what shifts depending on a reliability %, if thats the same then I look at the time stamp. I have...
0
7112
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
6974
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
7356
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
5448
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,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.