Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional 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
 
Old July 16th, 2003, 02:01 PM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP and a Schedule database

Hey Guys,

I wonder if you could direct me towards what I should be searching
for.

Is there a name for what I am trying to do?

I have a database table, where one column is time (30 minute increments), and then there is a column for Full Time employees who have started at each half hour, then another for part timers on a 4 hour shift, another for part timers on a 5 hour shift, and so on and so forth through to part timers on an 8 hour shift.

What I need to do now, is come up with the total staff who are working at each half hour increment for graphing on an ASP line graph I have. This has to take into account all the people who are present at any give half hour (not just those whom have started at that half hour), so it has to be able to recognize that a pt4 employee who starts at 8am, will be off at 12pm for example.

I thought it was going to be easy, but the math of it is eluding me.

Can you point me in the right direction of what I should be searching for on the net? Have you seen or coded any similar examples?

Thanks in advance,
 
Old July 16th, 2003, 09:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

If you where to store the start time and end time of each employee in another table it would be very easy.
loop through the half hour intervals and count the number of records/employees whos start time is before or equal to the interval time and finish time is after the interval time.:D


As your table stands
You would have to loop through the interval times-- and "count" those who started at that time, then add the four hour starters who's starting interval is greater than the interval in question - 4 hours, then add the five hour starters who's starting interval is greater than the interval in question - 5 hours, etc

Basically, using a different query for each time interval and summing the starters
ie:
Select a distinct set of starting times
loop through the starting times
select a count of the empoyees who start at that starting time
select a count of the 4 hr PT's how have a starting time less than this time and greater than this time less four hours.
Add this count to previous
select a count of the 5 hr PT's how have a starting time less than this time and greater than this time less five hours.
Add this count to previous
and so on...
then do this for the next starting time
and so on





Similar Threads
Thread Thread Starter Forum Replies Last Post
schedule C-Sharp process Derf ASP.NET 2.0 Professional 9 April 18th, 2008 10:21 PM
About schedule Task brijit VB.NET 2002/2003 Basics 1 November 8th, 2006 01:21 PM
Activity schedule edubbelaar Access 3 November 24th, 2004 11:21 AM
schedule in calender rita General .NET 0 June 19th, 2004 03:37 PM
Schedule a sychronisation ppenn Access 1 November 12th, 2003 09:45 PM





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