473,769 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Splitting Date/Time Records

1 New Member
PLEASE HELP!!!!

Needing help with developing a stored proc for the following:

Production crews work at the following times:
CREW A = 7:30AM to 3:30PM
CREW B = 3:30PM to 11:30PM
CREW C = 11:30PM to 7:30AM

- There are Record_Begin_Da te and Record_End_Date time/date fields in the database.
- There is logic in place that figures out which shift WAS Working at each time

The logic is briefly described below:
Record_Begin_Da te
- Determine which shift for the time
- If Record_Begin_Da te is Between 7:30AM to 3:30PM then it's Shift A
- If Record_Begin_Da te is Between 3:30PM to 11:30PM then it's Shift B
- If Record_Begin_Da te is Between 11:30PM to 7:30AM then it's Shift C

Record_End_Date
- Determine which shift for the time
- If Record_End_Date is Between 7:30AM to 3:30PM then it's Shift A
- If Record_End_Date is Between 3:30PM to 11:30PM then it's Shift B
- If Record_End_Date is Between 11:30PM to 7:30AM then it's Shift C

-------------------------------------------------------------------------------------------------------

Some of these records CROSS OVER shifts. Let's say the Record_Begin_Da te is at 2/01/2007 7:30AM and the Record_End_Date is 3:45PM. That means that the record crosses over into another shift.

We need to CHARGE each shift with their time WITHIN the Record_Begin_Da te and Record_End_Date .

So it will go something like this:
Record_Begin_Da te 2/1/07 7:50AM
Record_End_Date 2/1/07 3:45PM
1. Logic will evaluate to see if the Record_Begin_Da te or Record_End_Date crosses over shifts.
2. Figure out how much time of that goes to each shift.
Something like: Shift A had 20 minutes and Shift B had 15 minutes
3. Re-calculate a few things
4. insert new records in the database.

Your help is greatly greatly appreciated with this problem!!!
Feb 23 '07 #1
0 1187

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

Similar topics

5
7105
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an empty database, the date time picker returns error 545. Any attempts to progmatically add new records after the empty database has been opened returns, or to use the DTP and set a new date for those added records, "Field not updateable, Bound...
3
7367
by: nectar | last post by:
Hello In VBA I need to count records from an Offers table, that were created beetwen 2 dates (strDate1 and strDate2). Using the DCount as follow gives me strange results: records that were
3
15952
by: David Kuhn | last post by:
I have a query with a date field criteria of: Between And When the query is run, I am asked for the Start date and then the End Date. So far, so good. The records returned are all those in between those dates and not records that are on the start or the end date. For example, I enter "09/01/03" for the start date and "09/30/03" for
5
4304
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I could retrieve all the records for a specific date if I hard-code the date into the query, but not if I want to prompt the user. Has anybody else experienced this? Does anybody have any suggestions?
2
2461
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data into an access database to manipulate it. In the table I have: FIRSTNAME | LASTNAME | BADGE# | DATE | TIME The problem is that the time clock doesn’t differentiate between a “clock in” and a “clock out”. It only records badge...
7
2463
by: Nicolae Fieraru | last post by:
Hi All, I have a table tblProducts where I have four fields:\ Index, ProductName, EnterDate (as Date/Time - Medium Date), PurchaseDate (Date/Time - Medium Date) The EnterDate is automatically filled (with Now()) and the purchase date is entered manually. Meantime I became aware that instead of Now() I should use Date() for the date
3
1849
by: dfritt | last post by:
I have a table with records that I want to split up based on a start and end date. I am new MS Access and VB and would appreciate an example of some code that could be used to do this ?, even through Excel would be fine Example : Leave Record Table Employee Start_Date End_Date Units Taken 001 2007/10/01 2007/10/03 3 002 2007/10/02 2007/10/04 2
5
2511
by: sara | last post by:
Hi - I have had this problem MANY times and I just don't think I have the best solution. I am running a parameter query to retrieve records where work was completed between 2 dates. The "completed date" field contains both date and time (e.g., 11/4/07 15:44:00) and does need the time for the data to be properly recorded. That said, is it possible to format the parameter "Between and " to enable the user to enter just the
4
1660
by: OzNet | last post by:
I have a form with a subform and I need to filter the records in the subform by dates. (Access 2007) The main form has two unbound text boxes called StartFilter and EndFilter. Both use the Datepicker feature. Both have the Now() function as the Default setting to limit records to today's date as the default setting. Both are set to the short date format. Both have a small procedure: DoCmd.Requery Me.Refresh. to refresh the data on change....
0
10039
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9860
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5297
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.