?
Solved

Creating an automated process based on set dates

Posted on 2005-05-09
5
Medium Priority
?
194 Views
Last Modified: 2013-12-24
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
0
Comment
Question by:synergeticsoul
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:adonis1976
ID: 13959703
what i see from ur statement is that no two shows can be played at the same time.. am i right?
0
 

Author Comment

by:synergeticsoul
ID: 13959752
correct.  however, everything is archived.  

i don't want to have to manually enter

AND sjEventsShow.showno=7 (showno changes)

every week.
0
 
LVL 11

Accepted Solution

by:
adonis1976 earned 500 total points
ID: 13959948
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
 

Author Comment

by:synergeticsoul
ID: 13960520
okay.  I will try that (since the shows have just started)
0
 

Author Comment

by:synergeticsoul
ID: 13962286
is there any other way to handle this?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question