Results 1 to 6 of 6

Thread: Need advice on a scheduling project with SQL backend

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question Need advice on a scheduling project with SQL backend

    I'm writing a project to schedule a task on certain days of the week at certain times. I have choices of 8:00 am, 8:15 am,.... 5:00 pm and choices for the seven week days.

    The problem with SQL is that the datetime field also needs a date, not just a time, but I don't want to have to restrict it to having a set date (unless I picked the minimum (Jan 1, 1753?) as the default date...

    One solution that I considered was to fill a table with all the future dates and times possibly available for scheduling like until Dec 31, 9999, but that would be a huge table. This would be easier for showing the next scheduled date/time the task should run but would be hard to set using certain times and days of the week as options.

    So my only solution was to have a table with an ID (int) and a varchar(8) to hold the time values and a table with an ID (int) and varchar(10) for days of the week.

    The problem comes when I want to show the scheduled date and time when the task is next scheduled to run. What's the simplest way to find this? And then do I store it or just calculate it for every task?

    I know this is long, but somebody surely has run into this before. Any suggestions will be appreciated.
    Last edited by wey97; Apr 11th, 2005 at 10:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width