Creating an automated process based on set dates

I would like to create an automated process for an online show.

I created a stored procedure that would allow me to insert the shows and update.
The admin first adds the show (number and date of airing).  Then the admin adds the events, selects the corresponding show, and finally adds subsequent audio files for that event.  This all works fine.

However, I want the shows to play automatically, based on date.
I have airdate (which is when the show will air) and the actual show number.  The problem is that I tried to set the shows to air according to the date.
Show #4 will air on May 15, 2005.  So Show 3, should still play until May 15, 2005. Currently, all shows play for a week.  As each show is added, all have set airdates(which vary).  

I tried the following in my query, but the Date portion seems useless.  How can I modify this?

SELECT * FROM sjEventsSegments
INNER JOIN sjEventsAudio
ON sjEventsSegments.sjEventID=sjEventsAudio.sjEventID
INNER JOIN sjEventsShow
ON sjEventsShow.sjEventID=sjEventsSegments.sjEventID
WHERE sjEventsShow.airdate <= #createodbcdatetime(now())#
AND sjEventsShow.showno=7
AND sjEventsAudio.sizeType=2  <!--- Always stays the same --->
ORDER BY sjEventsSegments.sjEventID ASC
synergeticsoulAsked:
Who is Participating?
 
adonis1976Connect With a Mentor Commented:
can you do this?

have another field in your DB say "airDateExpire".

When the Admin adds the new show, what you can do is set the "airDateExpire" date of the previous or already entered with the airdate of the new one.. so when the new one kicks in, the older one will not show up as it is expired.. and ur sql will look like this:

SELECT * FROM sjEventsSegments
INNER JOIN sjEventsAudio
ON sjEventsSegments.sjEventID=sjEventsAudio.sjEventID
INNER JOIN sjEventsShow
ON sjEventsShow.sjEventID=sjEventsSegments.sjEventID
AND sjEventsShow.airDateExpire >= #createodbcdatetime(now())#
AND sjEventsAudio.sizeType=2  <!--- Always stays the same --->
ORDER BY sjEventsSegments.sjEventID ASC
0
 
adonis1976Commented:
what i see from ur statement is that no two shows can be played at the same time.. am i right?
0
 
synergeticsoulAuthor Commented:
correct.  however, everything is archived.  

i don't want to have to manually enter

AND sjEventsShow.showno=7 (showno changes)

every week.
0
 
synergeticsoulAuthor Commented:
okay.  I will try that (since the shows have just started)
0
 
synergeticsoulAuthor Commented:
is there any other way to handle this?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.