Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 16th, 2003, 02:01 PM
Registered User
 
Join Date: Jul 2003
Location: Calgary, AB, Canada.
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,
Reply With Quote
  #2 (permalink)  
Old July 16th, 2003, 09:56 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.